Re: Rendering a View into an Image
Re: Rendering a View into an Image
- Subject: Re: Rendering a View into an Image
- From: Charles Jolley <email@hidden>
- Date: Wed, 10 Oct 2001 09:55:08 -0500
Hi Joar:
Thanks for your response. I appreciate the tips!
On Wednesday, October 10, 2001, at 09:44 AM, j o a r wrote:
NSBitmapImageRep *myBitmap = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:[myView bounds]];
That's not an NSImage, but you can turn it into one, something like
this:
My experience has shown this to work only if the view is visible in the
window. In fact, if a view is only partially visible, then it will only
render the visible portion into the image.
I think you could go directly to an image like this:
NSImage *myImage = [[NSImage alloc] initWithData: [myView
dataWithPDFInsideRect:[myView bounds]]];
I wonder how complex this is. It seems like if I am wanting to just
cache a rendered view, this is a fairly complicated way to do it. Does
anyone know how "heavy weight" this approach would be?
-C