Re: Draw windows offscreen
Re: Draw windows offscreen
- Subject: Re: Draw windows offscreen
- From: Pierre CHATEL <email@hidden>
- Date: Thu, 16 Jun 2005 13:19:47 -0300
I want to modify the NSWindow class so that when 'makeKeyAndOrderFront' is called the window instance is drawed offscreen and I can get a NSBitmapImageRep with the entire window.
What exactly are you going to do with this bitmap? Reading a bitmap off the window can be slow. If you are going to use that bitmap for further drawing into another window, you'd be better of using CGLayerRef (new in 10.4). Alternatively, you might find -[NSView bitmapImageRepForCachingDisplayInRect:] to suit your needs (not sure if the NSBitmapImageRep that comes back from this lives on the GPU or not).
I think this will not work since bitmapImageRepForCachingDisplayInRect: is an NSView method. And NSWindow is not an NSView sublcass. I could use -[NSBitmapImageRep initWithFocusedViewRect:] to grab an entire window , but it will only work with on-screen windows.
What i need to find is a way to pre-render the entire window as a CIImage BEFORE it's even displayed on screen, and i thought that the best way to do that was first to render it as an NSBitmapImageRep and then use [[CIImage alloc] initWithBitmapImageRep:bitmap]; If there's such a method, i could hook it in a NSWindow method like makeKeyAndOrderFront in order to catch the display event. I'm open for any suggestions :-)
Pierre
|
_______________________________________________
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