drawing view pieces into images
drawing view pieces into images
- Subject: drawing view pieces into images
- From: Francisco Tolmasky <email@hidden>
- Date: Sat, 24 Jan 2004 18:02:53 -0800
I'm a little rusty on my drawing commands. What I have is a view of
size w,h. I have an image within the view that serves as a buffer. At
one point I want to draw the contents of the rect (100,150,20,20) into
an image temporarily for later use. So what I do is make an NSImage of
size 20,20: NSimage *image= [[NSImage alloc] initWithSize:
NSMakeSize(20,20)]; Now what I'[m not sure of is how to tell it to
draw what is at 100,150 to the image's 0,0. Something like this is
what I'm thinking about:
[image lockFocus];
[image setBoundsOrigin: NSMakePoint(100,150)];
[self drawRect: NSMakeRect(100,150,20,20)];
[image unlockFocus];
but image does not have a setBoundsOrigin nor a setBounds. How should
I do this?
Francisco Tolmasky
email@hidden
http://users.adelphia.net/~ftolmasky
_______________________________________________
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.