• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rendering a View into an Image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Rendering a View into an Image
      • From: James DiPalma <email@hidden>
  • Prev by Date: FW: Classes for a dummy dummy <NSImage access>.
  • Next by Date: Undo Causes Document Window to be Retained
  • Previous by thread: Rendering a View into an Image
  • Next by thread: Re: Rendering a View into an Image
  • Index(es):
    • Date
    • Thread