Re: How to draw a CGImage object to a NSView?
Re: How to draw a CGImage object to a NSView?
- Subject: Re: How to draw a CGImage object to a NSView?
- From: "Ken Ferry" <email@hidden>
- Date: Wed, 20 Feb 2008 14:34:50 -0800
..not that you need to do this if you already have a custom view
subclass. Then you should just draw the CGImage from within drawRect,
as glenn described.
-Ken
On Wed, Feb 20, 2008 at 2:29 PM, Ken Ferry <email@hidden> wrote:
> > I think it will cost too much performance to convert the CGImage objects to other formats, e.g. NSImage, CIImage.
>
> It isn't very expensive to make an NSImage from a CGImage. If you
> create an NSBitmapImageRep with -initWithCGImage:, the
> NSBitmapImageRep will just reference the CGImage and draw it when
> necessary. There is no conversion of the data.
>
> -Ken
>
>
>
> On Wed, Feb 20, 2008 at 2:21 PM, Leopard x86
> <email@hidden> wrote:
> > Hi everyone.
> > After reading the Quartz Graphics programming document, I am still
> > trying to find a method to draw a CGImageRef object "directly" to a
> > NSView / NSOpenGLView ...
> >
> > My application decodes some files on the disk to into CGDataProvider,
> > then uses the CGDataProviders to create CGImageRefs. I think it will
> > cost too much performance to convert the CGImage objects to other
> > formats, e.g. NSImage, CIImage. So I am wondering a direct way to draw
> > CGImage to a NSView or NSOpenGLView.
> >
> > Can anyone give me a suggestion? Thank you very much in advanced.
> > Good Luck.
> > _______________________________________________
> >
> > Cocoa-dev mailing list (email@hidden)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
> >
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden