Re: Image of a view
Re: Image of a view
- Subject: Re: Image of a view
- From: Charles Jolley <email@hidden>
- Date: Tue, 18 Jun 2002 14:44:10 -0500
Does the view you are trying to draw have subviews? If it does, drawing
to an NSImage becomes much more difficult. I posted a class to this
list some time ago that has some code for doing this. (Called
OKBufferedView) Note: it is over kill if you do not have subviews to
draw as well.
Cheers,
-Charles
On Tuesday, June 18, 2002, at 10:18 AM, email@hidden wrote:
I'm having trouble creating an image of a view for dragging. First I
create an image of the view using this code:
NSBitmapImageRep *myBitmap = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:[myView bounds]];
This code, I believe is correct but it doesn't seem to work. I have two
outlets:
-myView
-myImage
then the usual:
[myImage setImage:myBitmap];
I'm I doing this right? Is there a better way to do this? Is there an
example of dragging views (i've looked at the image dragging example by
Apple which is really helpful for dragging images but I need to drag a
view ie. Image & Text at the same time.)
Ideally I need something like the system preferences where you can drag
a prefPane to the toolbar.
Thanks in advance for any help.
Luke.
_______________________________________________
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.
_______________________________________________
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.