Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSEPSImageRep to NSBitmapImageRep to GWorld problems



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) Aloc 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!
_______________________________________________
quicktime-talk mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-talk
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.