Re: Drawing an NSImage into a GWorld
Re: Drawing an NSImage into a GWorld
- Subject: Re: Drawing an NSImage into a GWorld
- From: Dave Hersey <email@hidden>
- Date: Tue, 12 Jul 2005 13:38:40 -0400
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.
- Dave
On 7/12/05 11:04 AM, "Darrin Cardani" <email@hidden> wrote:
> I'm working on an iMovie plugin. In iMovie, you have to return the
> final rendered frame as a GWorld. However, I have an NSImage (which
> is known to have an NSBitmapImageRep) that I need to draw into that
> GWorld. What's the easiest way to do that?
>
> I realize I could convert the NSImage into a CGImageRef and wrap a
> CGBitmapContext around the GWorld, then draw the CGImageRef into
> that, but that seems rather roundabout.
>
> I could also get the bitmap representation's raw pixel data into
> another GWorld and use CopyBits to get it into the final (differently
> sized) GWorld. But I'm wondering if there's a recommended way to do
> it?
>
> Thanks,
> Darrin
_______________________________________________
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