Re: How to obtain a NSImage with the content of a NSView ?
Re: How to obtain a NSImage with the content of a NSView ?
- Subject: Re: How to obtain a NSImage with the content of a NSView ?
- From: David Remahl <email@hidden>
- Date: Sun, 31 Mar 2002 18:32:20 +0200
>
I want to obtain a NSImage with the content of a NSView, I have tried :
>
>
NSImage *background;
>
NSRect r = [aView bounds];
>
background = [[NSImage alloc] initWithData:[aView
>
dataWithPDFInsideRect:r]];
>
>
but background is nil when I run this code.
NSBitmapImageRep has a method initWithContentsOfFocusedView: or something
along those lines. lockFocus on your view and create a NSBitmapImageRep with
that. Then insert it in an NSImage.
/ David Remahl
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.