Re: Drawing an NSImage into a GWorld
Re: Drawing an NSImage into a GWorld
- Subject: Re: Drawing an NSImage into a GWorld
- From: Darrin Cardani <email@hidden>
- Date: Tue, 12 Jul 2005 13:57:48 -0500
At 11:39 AM -0700 7/12/05, Dave Hersey <email@hidden> wrote:
Check out the CocoaCreateMovie sample for one approach.
Specifically in:
http://developer.apple.com/samplecode/CocoaCreateMovie/listing3.html
Find CopyNSImageToGWorld at the bottom.
This code will replace the existing bitmap data in the GWorld, not merge
pixels. It doesn't sound like that matters in your case. If it does, you
could handle that several ways.
Thanks so much for the pointer! I was actually just trying something
like this out, and I'm running into a problem. The image in question
is loaded from my plugin's bundle, so I know that it's a bitmap image
and not a PDF or other vector image. However, I load the image using
[+NSImage initWithContentsOfFile:]; It seems that just doing that
isn't enough for it to create any representations, as calling [image
representations] returns nil. Looking through the docs for NSImage, I
don't see how to get it to load a representation other than by
drawing it into a view somewhere. But I don't need it drawn into any
view, I just need its pixel data. So how do I get it to load at least
1 representation?
For what it's worth, I've tried setting the caching mode to both
always and never, and setting the data to always be retained, but
neither helps.
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden