On 17-Mar-07, at 2:25 PM, Alexander Cohen wrote: > Does anyone have any sample code on how to convert a REALpicture to a > CGImageRef?
This should probably be easy in Cocoa targets but for now I'm pretty sure you have to jump through some hoops: 1). Grab a REALpictureDescription with REALLockPictureDescription asking for a pictureMacintoshGWorld 2). Use QDBegin/EndCGContext on REALpictureDescription.pictureData to get a CGContextRef 3). Use CGBitmapContextCreateImage (or some other mechanism) to get a CGImageRef from the CGContextRef This should be pretty straightforward but there's code up to step #2 in the PNG Utilities plugin if you want an example (hit the link in my sig). Unfortunately CGBitmapContextCreateImage requires Mac OS X 10.4, and supporting lesser systems may require copying the data out of the CGContextRef and creating the CGImageRef manually (PNG Utilities copies the data, but for different reasons). Frank. <http://developer.chaoticbox.com/> _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
