NSEPSImageRep to NSBitmapImageRep to GWorld problems
NSEPSImageRep to NSBitmapImageRep to GWorld problems
- Subject: NSEPSImageRep to NSBitmapImageRep to GWorld problems
- From: email@hidden
- Date: Sat, 29 Nov 2003 18:44:32 EST
Hi,
I've been attempting to draw an NSEPSImapgeRep image into a GWorld and have
had suboptimal luck doing so. (and yes I am using Panther which is supposed to
fix EPS.)
To make a long story short I:
1) Alloc and load the image with [[NSImage alloc] initWithContentsOfFile: <
filename>]
2) lockFocus on the image, then
3) [[NSBitmapImageRep alloc] initWithFocusedViewRect:<myNSRect>] to pull the
image into a bitmap,
4) and then use Apple's sample code CopyNSImageToGWorld(NSImage *, GWorldPtr)
to copy the image into a GWorld. (Note: I did modify their code slightly to
handle both 24-bit and 32-bit NSImages...their original sample was setup for
24-bit only).
The problem is that while my bitmap image representation reports to have one
plane the image comes out in just one color, blue. I was expecting the mesh
of RGB.
Does anyone have any ideas what my problem could be? My first guess was that
the bitmap actually had multiple color planes encoded in some way that was
not obvious to me. Is it possible NSEPSImageRep does not correctly map into a
NSBitmapImageRep?
You can find Apple's same code for CopyNSImageToGWorld at:
//developer.apple.com/samplecode/Sample_Code/QuickTime/Basics/CocoaCreateMovie/MyController.m.htm
Thanks!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.