• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetGWorldPixMap函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetGWorldPixMap函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGWorldPixMap函数的具体用法?C++ GetGWorldPixMap怎么用?C++ GetGWorldPixMap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetGWorldPixMap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UnlockPixels

void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
    if ( m_selected.Ok() )
    {
        UnlockPixels( GetGWorldPixMap(MAC_WXHBITMAP(m_selected.GetHBITMAP())) );
    }
    m_selected = bitmap;
    if (m_selected.Ok())
    {
        if ( m_selected.GetHBITMAP() )
        {
            m_macPort = (GrafPtr) m_selected.GetHBITMAP() ;
            LockPixels( GetGWorldPixMap(  (CGrafPtr)  m_macPort ) ) ;
            wxMask * mask = bitmap.GetMask() ;
            if ( mask )
            {
                m_macMask = mask->GetMaskBitmap() ;
            }
            SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , 0 , 0 , m_selected.GetWidth() , m_selected.GetHeight() ) ;
            CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle)  m_macCurrentClipRgn ) ;
            m_ok = TRUE ;
        }
        else
        {
            m_ok = FALSE;
        }
    }
    else
    {
        m_ok = FALSE;
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:32,代码来源:dcmemory.cpp


示例2: GetPixBaseAddr

//--------------------------------------------------------
void ofQtVideoSaver::setGworldPixel( GWorldPtr gwPtr, int r, int g, int b, short x, short y){
	Ptr    gwAddress, gwAddressBase;
    long   gwWidth;
    char   red, blue, green;
    gwAddressBase = GetPixBaseAddr( GetGWorldPixMap( gwPtr ) );   /* Get head address of offscreen      */
    gwWidth = ( **GetGWorldPixMap( gwPtr ) ).rowBytes & 0x3fff;   /* Get with of offscreen              */
    gwAddress = gwAddressBase + ( x * 3 ) + ( y * gwWidth );  /* Get adress for current pixel       */
    *gwAddress = (unsigned char)r;                        /* Put red and move address forward   */
    *(gwAddress+1) = (unsigned char)g;                /* Put green and move address forward */
    *(gwAddress+2)   = (unsigned char)b;                       /* Put blue                           */
}
开发者ID:jphutson,项目名称:dynamic-images-and-eye-movements,代码行数:12,代码来源:ofQtVideoSaver.cpp


示例3: QTNewGWorldFromPtr

// Create the offscreen GWorld (using Image  as target memory)
void QuicktimeLiveImageStream::createGWorld()
{
    Rect         destinationBounds;
    OSStatus     err;
    GDHandle     origDevice;
    CGrafPtr     origPort;
    destinationBounds.left   = 0;
    destinationBounds.top    = 0;
    destinationBounds.right  = m_videoRectWidth;
    destinationBounds.bottom = m_videoRectHeight;
    err = QTNewGWorldFromPtr(&m_gw, k32ARGBPixelFormat, &destinationBounds,
                             NULL, NULL, 0, (Ptr)data(), 4*m_videoRectWidth);
    if (err !=0 )
    {
        OSG_DEBUG << "Could not create gWorld" << std::endl;
    }
    else
    {
        // Query
        GetGWorld (&origPort, &origDevice);
        SetGWorld (m_gw, NULL); // set current graphics port to offscreen
        m_pixmap = GetGWorldPixMap(m_gw);
        if (m_pixmap)
         {
             if (!LockPixels (m_pixmap)) // lock offscreen pixel map
             {
                 OSG_FATAL << "Could not lock PixMap" << std::endl;
             }
         }
        // Set back
        SetGWorld(origPort, origDevice);
    }
}
开发者ID:aalex,项目名称:osg,代码行数:34,代码来源:QuicktimeLiveImageStream.cpp


示例4: defined

void ofQuickTimePlayer::createImgMemAndGWorld(){
	Rect movieRect;
	movieRect.top 			= 0;
	movieRect.left 			= 0;
	movieRect.bottom 		= height;
	movieRect.right 		= width;
    if (pixelFormat == OF_PIXELS_RGBA) {
        pixels.allocate(width, height, OF_IMAGE_COLOR_ALPHA);
    } 
    else {
        pixels.allocate(width, height, OF_IMAGE_COLOR);
    }

	#if defined(TARGET_OSX) && defined(__BIG_ENDIAN__)
		offscreenGWorldPixels = new unsigned char[4 * width * height + 32];
		QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width);		
	#else
        if (pixelFormat == OF_PIXELS_RGBA) {
            QTNewGWorldFromPtr (&(offscreenGWorld), k32RGBAPixelFormat, &(movieRect), NULL, NULL, 0, (pixels.getPixels()), 4 * width);
        }
        else {
            QTNewGWorldFromPtr (&(offscreenGWorld), k24RGBPixelFormat, &(movieRect), NULL, NULL, 0, (pixels.getPixels()), 3 * width);
        }
	#endif

	LockPixels(GetGWorldPixMap(offscreenGWorld));
	SetGWorld (offscreenGWorld, NULL);
	SetMovieGWorld (moviePtr, offscreenGWorld, nil);

}
开发者ID:ColoursAndNumbers,项目名称:openFrameworks,代码行数:30,代码来源:ofQuickTimePlayer.cpp


示例5: UnlockPixels

void _HYPlatformGraphicPane::_EndDraw	 (void)
{
	UnlockPixels (GetGWorldPixMap(thePane));
	SetGWorld 	 (savedPort,savedDevice);
	RGBForeColor (&saveFG);
	RGBBackColor (&saveBG);
}				
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:7,代码来源:HYPlatformGraphicPane.cpp


示例6: defined

void ofxAlphaVideoPlayer::createImgMemAndGWorld(){
	Rect movieRect;
	movieRect.top 			= 0;
	movieRect.left 			= 0;
	movieRect.bottom 		= height;
	movieRect.right 		= width;
	offscreenGWorldPixels 	= new unsigned char[4 * width * height + 32];
	pixels					= new unsigned char[width*height*4]; // 4 =>rgba

	#if defined(TARGET_OSX) && defined(__BIG_ENDIAN__)
		//cout << "with Big Endian"<<endl;
		QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width);		
	#else
		//cout << "no Big Endian"<<endl;
		QTNewGWorldFromPtr (&(offscreenGWorld), k32RGBAPixelFormat, &(movieRect), NULL, NULL, 0, (pixels), 4 * width);
	#endif
	/** POSSIBLE PIXEL FORMATS 
	k32BGRAPixelFormat            = 'BGRA', // 32 bit bgra    (Matrox)
	k32ABGRPixelFormat            = 'ABGR', // 32 bit abgr   
	k32RGBAPixelFormat            = 'RGBA', // 32 bit rgba   	
	 ***********/
	LockPixels(GetGWorldPixMap(offscreenGWorld));
	SetGWorld (offscreenGWorld, NULL);
	SetMovieGWorld (moviePtr, offscreenGWorld, nil);
	//------------------------------------ texture stuff:
	if (bUseTexture){
		// create the texture, set the pixels to black and
		// upload them to the texture (so at least we see nothing black the callback)
		tex.allocate(width,height,GL_RGBA);
		memset(pixels, 0, width*height*4);
		tex.loadData(pixels, width, height, GL_RGBA);
		allocated = true;
	}
}
开发者ID:runemadsen,项目名称:Ohland-Balloons-P3,代码行数:34,代码来源:ofxAlphaVideoPlayer.cpp


示例7: defined

void ofQuickTimePlayer::createImgMemAndGWorld() {
    Rect movieRect;
    movieRect.top 			= 0;
    movieRect.left 			= 0;
    movieRect.bottom 		= height;
    movieRect.right 		= width;
    offscreenGWorldPixels = new unsigned char[4 * width * height + 32];
    pixels.allocate(width,height,OF_IMAGE_COLOR);

#if defined(TARGET_OSX) && defined(__BIG_ENDIAN__)
    QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width);
#else
    QTNewGWorldFromPtr (&(offscreenGWorld), k24RGBPixelFormat, &(movieRect), NULL, NULL, 0, (pixels.getPixels()), 3 * width);
#endif

    LockPixels(GetGWorldPixMap(offscreenGWorld));

    // from : https://github.com/openframeworks/openFrameworks/issues/244
    // SetGWorld do not seems to be necessary for offscreen rendering of the movie
    // only SetMovieGWorld should be called
    // if both are called, the app will crash after a few ofVideoPlayer object have been deleted

#ifndef TARGET_WIN32
    SetGWorld (offscreenGWorld, NULL);
#endif
    SetMovieGWorld (moviePtr, offscreenGWorld, nil);

}
开发者ID:qingchen1984,项目名称:3DPhotography,代码行数:28,代码来源:ofQuickTimePlayer.cpp


示例8: MacSetRect

void pxBuffer::blit(pxSurfaceNative s, int dstLeft, int dstTop, int dstWidth, int dstHeight, 
    int srcLeft, int srcTop)
{
		Rect pr;
		MacSetRect(&pr, 0, 0, width(), height());	
		
		GWorldPtr gworld;
		NewGWorldFromPtr (&gworld, 32, &pr, NULL, NULL, 0, (char*)base(), 4*width());

		Rect dr, sr;
		MacSetRect(&dr, dstLeft, dstTop, dstLeft + dstWidth, dstTop + dstHeight);
		MacSetRect(&sr, srcLeft, srcTop, srcLeft + dstWidth, srcTop + dstHeight);
		CopyBits((BitMapPtr)*GetGWorldPixMap(gworld),(BitMapPtr)*GetGWorldPixMap(s),&sr,&dr,srcCopy,NULL);
	
		DisposeGWorld(gworld);
}
开发者ID:codemodo,项目名称:pxCore,代码行数:16,代码来源:pxBufferNative.cpp


示例9: QutTexture_CreateCompressedTextureObjectFromFile

//=============================================================================
//		QutTexture_CreateCompressedTextureObjectFromFile :	Create a QD3D 
//															compressed texture.
//-----------------------------------------------------------------------------
TQ3TextureObject		
QutTexture_CreateCompressedTextureObjectFromFile(
									const FSSpec *	theFSSpec,
									TQ3PixelType	pixelType,
									TQ3Boolean		wantMipMaps)
{
	TQ3TextureObject	theTexture	= NULL;
	GWorldPtr			theGWorld	= NULL;
	PixMapHandle		thePixmap	= NULL;



	// Load the image, then create a texture from it
	theGWorld = QutTexture_CreateGWorldFromFile(theFSSpec, pixelType);
	if (theGWorld != NULL)
	{
		thePixmap	= GetGWorldPixMap(theGWorld);
		
		if( thePixmap != NULL)
		{
			theTexture = QutTexture_CreateCompressedTextureObjectFromPixmap(thePixmap, pixelType, wantMipMaps);
			DisposeGWorld(theGWorld);
		}
	}
	
	return(theTexture);
}
开发者ID:refnum,项目名称:quesa,代码行数:31,代码来源:QutTexture.c


示例10: pict_from_gworld

PRIVATE PicHandle
pict_from_gworld (GWorldPtr gp, int *lenp)
{
  PicHandle retval;

  if (!gp)
    retval = NULL;
  else
    {
      Rect pict_frame;
      PixMapHandle pm;

      pm = GetGWorldPixMap (gp);
      pict_frame = PIXMAP_BOUNDS (pm);
      retval = OpenPicture (&pict_frame);
      if (retval)
	{
	  ClipRect (&pict_frame);
	  HLock ((Handle) pm);
	  CopyBits ((BitMap *) STARH (pm), PORT_BITS_FOR_COPY (thePort),
		    &pict_frame, &pict_frame, srcCopy, NULL);
	  HUnlock ((Handle) pm);
	  ClosePicture ();
	}
    }
  return retval;
}
开发者ID:LarBob,项目名称:executor,代码行数:27,代码来源:scrap.c


示例11: EraseRectAndAlpha

void EraseRectAndAlpha(GWorldPtr gWorld, Rect *pRect)
{
	PixMapHandle	pixMap = GetGWorldPixMap(gWorld);
	long			rows;
	Ptr				rowBaseAddr;


    LockPixels(pixMap);
	rows = pRect->bottom - pRect->top;
    
    rowBaseAddr = GetPixBaseAddr(pixMap) + (GetPixRowBytes(pixMap) & 0x3fff) * pRect->top + pRect->left * GetPixDepth(pixMap) / 8;
	do
	{
		long	cols;
		UInt32	*baseAddr;
		
		cols = pRect->right - pRect->left;
		baseAddr = (UInt32*)rowBaseAddr;
		rowBaseAddr += (**pixMap).rowBytes & 0x3fff;
		do
		{
			*baseAddr++ = 0;
		} while (--cols);
	} while (--rows);

    UnlockPixels(pixMap);

} // EraseRectAndAlpha
开发者ID:fruitsamples,项目名称:VideoProcessing,代码行数:28,代码来源:QTUtilities.c


示例12: CreateDecompSeqForGWorldData

OSErr CreateDecompSeqForGWorldData(GWorldPtr srcGWorld, Rect *srcBounds, MatrixRecordPtr mr, GWorldPtr imageDestination, ImageSequence *imageSeqID)
{
    OSErr err;
    
    ImageDescriptionHandle imageDesc = (ImageDescriptionHandle)NewHandle(sizeof(ImageDescription));
    if (imageDesc)
    {
        err = MakeImageDescriptionForPixMap (GetGWorldPixMap(srcGWorld), &imageDesc);
        err = DecompressSequenceBegin(	imageSeqID, 
                                        imageDesc, 
                                        imageDestination, 
                                        0, 
                                        srcBounds, 
                                        mr, 
                                        srcCopy, 
                                        nil, 
                                        0, 
                                        codecNormalQuality, 
                                        bestSpeedCodec);
        DisposeHandle((Handle)imageDesc);
    }
    else
    {
        err = MemError();
    }
    
    return err;
}
开发者ID:fruitsamples,项目名称:VideoProcessing,代码行数:28,代码来源:QTUtilities.c


示例13: RGB2IndexGW

// Same as above except that it quickly uses a gworld to allow the systems excellent routines to do
// the business instead.
short RGB2IndexGW(CTabHandle theTable,RGBColor *theCol)
{
	Boolean		openWorld=false;
	short		index=-1;
	
	if (gBL_TintWorld==0L)
	{
		openWorld=true;
		OpenTintWorld(theTable);
	}
	
	if (gBL_TintWorld)
	{
		CGrafPtr	origPort;
		GDHandle	origGD;
		
		GetGWorld(&origPort,&origGD);
		SetGWorld(gBL_TintWorld,0L);
		SetCPixel(0,0,theCol);
		index=GPixelColour(GetGWorldPixMap(gBL_TintWorld),0,0);
		SetGWorld(origPort,origGD);
	}
	else
		return -1;

	if (openWorld)
		CloseTintWorld();

	return index;
}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:32,代码来源:BLAST+Tint.c


示例14: ROM_UnsetVideoMode

static void ROM_UnsetVideoMode(_THIS, SDL_Surface *current)
{
	/* Free the current window, if any */
	if ( SDL_Window != nil ) {
		GWorldPtr memworld;
		
		/* Handle OpenGL support */
		Mac_GL_Quit(this);

		memworld = (GWorldPtr)GetWRefCon(SDL_Window);
		if ( memworld != nil ) {
			UnlockPixels(GetGWorldPixMap(memworld));
			DisposeGWorld(memworld);
		}
		if ( (current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
#if USE_QUICKTIME
			EndFullScreen(fullscreen_ctx, nil);
			SDL_Window = nil;
#else
			ROM_ShowMenuBar(this);
#endif
		}
	}
	current->pixels = NULL;
	current->flags &= ~(SDL_HWSURFACE|SDL_FULLSCREEN);
}
开发者ID:3bu1,项目名称:crossbridge,代码行数:26,代码来源:SDL_romvideo.c


示例15: defined

void ofVideoPlayer::createImgMemAndGWorld(){
	Rect movieRect;
	movieRect.top 			= 0;
	movieRect.left 			= 0;
	movieRect.bottom 		= height;
	movieRect.right 		= width;
	offscreenGWorldPixels 	= new unsigned char[4 * width * height + 32];
	pixels					= new unsigned char[width*height*3];

	#if defined(TARGET_OSX) && defined(__BIG_ENDIAN__)
		QTNewGWorldFromPtr (&(offscreenGWorld), k32ARGBPixelFormat, &(movieRect), NULL, NULL, 0, (offscreenGWorldPixels), 4 * width);		
	#else
		QTNewGWorldFromPtr (&(offscreenGWorld), k24RGBPixelFormat, &(movieRect), NULL, NULL, 0, (pixels), 3 * width);
	#endif

	LockPixels(GetGWorldPixMap(offscreenGWorld));
	SetGWorld (offscreenGWorld, NULL);
	SetMovieGWorld (moviePtr, offscreenGWorld, nil);
	//------------------------------------ texture stuff:
	if (bUseTexture){
		// create the texture, set the pixels to black and
		// upload them to the texture (so at least we see nothing black the callback)
		tex.allocate(width,height,GL_RGB);
		memset(pixels, 0, width*height*3);
		tex.loadData(pixels, width, height, GL_RGB);
		allocated = true;
	}
}
开发者ID:alejandroflores,项目名称:openFrameworks,代码行数:28,代码来源:ofVideoPlayer.cpp


示例16: GetGWorldPixMap

    //------------------------------------------------------------------------
    unsigned pixel_map::width() const
    {
        if(m_pmap == nil) return 0;
		PixMapHandle	pm = GetGWorldPixMap (m_pmap);
		Rect			bounds;
		GetPixBounds (pm, &bounds);
		return bounds.right - bounds.left;
    }
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:9,代码来源:agg_mac_pmap.cpp


示例17: gr_palette_step_up

void gr_palette_step_up( int r, int g, int b )
{
	int i;
	ubyte *p;
	int temp;
	ColorSpec colors[256];
	GDHandle old_device;
//	PaletteHandle palette;
//	RGBColor color;
//	CTabHandle ctab;

	if (gr_palette_faded_out) return;

	if ( (r==last_r) && (g==last_g) && (b==last_b) ) return;

	last_r = r;
	last_g = g;
	last_b = b;

	p=gr_palette;
//	palette = GetPalette(GameWindow);
	for (i=0; i<256; i++ )	{
		colors[i].value = i;
//		temp = (int)(*p++) + r + gr_palette_gamma;
		temp = (int)(*p++) + r;
		if (temp<0) temp=0;
		else if (temp>63) temp=63;
		colors[i].rgb.red = gr_mac_gamma[temp];
//		temp = (int)(*p++) + g + gr_palette_gamma;
		temp = (int)(*p++) + g;
		if (temp<0) temp=0;
		else if (temp>63) temp=63;
		colors[i].rgb.green = gr_mac_gamma[temp];
//		temp = (int)(*p++) + b + gr_palette_gamma;
		temp = (int)(*p++) + b;
		if (temp<0) temp=0;
		else if (temp>63) temp=63;
		colors[i].rgb.blue = gr_mac_gamma[temp];
//		SetEntryColor(palette, i, &color);
	}
	old_device = GetGDevice();
	SetGDevice(GameMonitor);
	SetEntries(0, 255, colors);
	SetGDevice(old_device);
#if 0
	ctab = (CTabHandle)NewHandle(sizeof(ColorTable));
	Palette2CTab(palette, ctab);
	AnimatePalette(GameWindow, ctab, 0, 0, 256);
	ActivatePalette(GameWindow);
	DisposeHandle((Handle)ctab);

	if (GameGWorld != NULL) {
		ctab = (**GetGWorldPixMap(GameGWorld)).pmTable;	// get the color table for the gWorld.
		CTabChanged(ctab);
		(**ctab).ctSeed = (**(**(*(CGrafPtr)GameWindow).portPixMap).pmTable).ctSeed;
	}
#endif
}
开发者ID:osgcc,项目名称:descent-mac,代码行数:58,代码来源:palette.c


示例18: bmp

// Operations:
bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
{
    wxBitmap bmp( icon ) ;
    OSStatus err = noErr ;

    CGImageRef pImage;
    
#if 0 // is always available under OSX now -- crashes on 10.2 in CFRetain() - RN
    pImage = (CGImageRef) bmp.CGImageCreate() ;
#else
    WXHBITMAP iconport ;
    WXHBITMAP maskport ;
    iconport = bmp.GetHBITMAP( &maskport ) ;

    if (!maskport)
    {
        // Make a mask with no transparent pixels
        wxBitmap   mbmp(icon.GetWidth(), icon.GetHeight());
        wxMemoryDC dc;
        dc.SelectObject(mbmp);
        dc.SetBackground(*wxBLACK_BRUSH);
        dc.Clear();
        dc.SelectObject(wxNullBitmap);
        bmp.SetMask( new wxMask(mbmp, *wxWHITE) ) ;
        iconport = bmp.GetHBITMAP( &maskport ) ;
    } 
    
    //create the icon from the bitmap and mask bitmap contained within
    err = CreateCGImageFromPixMaps(
                                            GetGWorldPixMap(MAC_WXHBITMAP(iconport)),
                                            GetGWorldPixMap(MAC_WXHBITMAP(maskport)),
                                            &pImage
                                            );    
    wxASSERT(err == 0);
#endif
    wxASSERT(pImage != NULL );
    err = SetApplicationDockTileImage(pImage);
    
    wxASSERT(err == 0);
    
    if (pImage != NULL)
        CGImageRelease(pImage);
    
    return m_iconAdded = err == noErr;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:46,代码来源:taskbar.cpp


示例19: DrawCompleteProc

static pascal OSErr DrawCompleteProc (Movie theMovie, long refCon) {

  long int h;
  long int w;
  int y, x;
  GWorldPtr offWorld = (GWorldPtr) refCon;
  Rect bounds;
  Ptr baseAddr;
  long rowBytes;
  uint8_t* imbuf;
  mwSize dims[3];

  GetPixBounds(GetGWorldPixMap(offWorld), &bounds);
  baseAddr = GetPixBaseAddr(GetGWorldPixMap(offWorld));
  rowBytes = GetPixRowBytes(GetGWorldPixMap(offWorld));

  h = rint(bounds.bottom - bounds.top);
  w = rint(bounds.right - bounds.left);

  dims[0] = h;
  dims[1] = w; 
  dims[2] = 3;

  framedata = mxCreateNumericArray(3, dims, mxUINT8_CLASS, mxREAL);
  imbuf = (uint8_t*) mxGetData(framedata);

  // Retrieve the pixel data, unpack the RGB values and copy 
  for (y = 0; y < h; ++y) {
    long *p;
    p = (long *) (baseAddr + rowBytes * (long) y);
    for (x = 0; x < w; ++x) {
      UInt32 color = *(long *)((long) p + 4 * (long) x);;
      long B = (color & 0xFF000000) >> 24;
      long G = (color & 0x00FF0000) >> 16;
      long R = (color & 0x0000FF00) >> 8;

      imbuf[y + x * h + 0 * (h * w)] = R;
      imbuf[y + x * h + 1 * (h * w)] = G;
      imbuf[y + x * h + 2 * (h * w)] = B;
    }
  }

  return noErr;
}
开发者ID:cabeen,项目名称:mat-qt,代码行数:44,代码来源:read_qt.c


示例20: ClearCurrentScrap

void _HYPlatformGraphicPane::_CopyToClipboard	(void)
{
	_HYGraphicPane* parent = (_HYGraphicPane*)this;
	#ifdef TARGET_API_MAC_CARBON
		ClearCurrentScrap();
	#else
		ZeroScrap();
	#endif
	Rect  bRect;
	
	bRect.left 			= bRect.top = 0;
	bRect.right 		= parent->w;
	bRect.bottom 		= parent->h;

	PicHandle	 pic 	= OpenPicture (&bRect);
	
	GrafPtr      topPort;
	GetPort		 (&topPort);
	
	LockPixels (GetGWorldPixMap(thePane));
	#ifdef OPAQUE_TOOLBOX_STRUCTS 
		CopyBits (GetPortBitMapForCopyBits(thePane),GetPortBitMapForCopyBits(topPort),
				&bRect,&bRect,srcCopy,(RgnHandle)nil);
	#else
		CopyBits ((BitMap*)*GetGWorldPixMap(thePane),
				  (BitMap*)&(topPort->portBits),&bRect,&bRect,
	    		   srcCopy,(RgnHandle)nil);
	#endif
	UnlockPixels (GetGWorldPixMap(thePane));
    			   
	ClosePicture ();
	HLock	((Handle)pic);		
						
	#ifdef TARGET_API_MAC_CARBON
		ScrapRef		 theScrapRef;
		GetCurrentScrap(&theScrapRef);
		PutScrapFlavor(theScrapRef, 'PICT', kScrapFlavorMaskNone,GetHandleSize((Handle)pic),*pic);
	#else
		PutScrap (GetHandleSize((Handle)pic),'PICT',*pic);
	#endif
	KillPicture (pic);	
}		
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:42,代码来源:HYPlatformGraphicPane.cpp



注:本文中的GetGWorldPixMap函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetGalCanvas函数代码示例发布时间:2022-05-30
下一篇:
C++ GetGValue函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap