• 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: NSView to NSBitmapRep Without an NSWindow?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView to NSBitmapRep Without an NSWindow?


  • Subject: Re: NSView to NSBitmapRep Without an NSWindow?
  • From: email@hidden
  • Date: Sun, 11 Sep 2005 00:34:24 +0800

You might try
- (NSImage *)imageFromView:(NSView *)theView
{
    NSRect viewBounds = [theView bounds];
    NSImage *image = [[NSImage alloc] initWithSize:viewBounds.size];
    [image setFlipped:YES]; // or maybe you won't need this
    [image lockFocus];
    NSEraseRect(viewBounds);
    [theView drawRect: viewBounds ];
    [image unlockFocus];
    return [image autorelease];
}
And then extract the NSBitmapImageRep from the NSImage
HTH,
James
On Sep 8, 2005, at 12:36 PM, Seth Willits wrote:

Is there any way to get an NSBitmapRep of the contents in an NSView *without* that view being in a window? Nothing I've tried works. Even briefly placing the view in a window way of screen doesn't work.

Thanks,

--
Seth Willits

_______________________________________________
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


_______________________________________________ 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
  • Follow-Ups:
    • Re: NSView to NSBitmapRep Without an NSWindow?
      • From: Troy Stephens <email@hidden>
References: 
 >NSView to NSBitmapRep Without an NSWindow? (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: How To Design A Queue of Messages?
  • Next by Date: Re: clickable text fields?
  • Previous by thread: NSView to NSBitmapRep Without an NSWindow?
  • Next by thread: Re: NSView to NSBitmapRep Without an NSWindow?
  • Index(es):
    • Date
    • Thread