Re: how to cut and paste from an image to other image
Re: how to cut and paste from an image to other image
- Subject: Re: how to cut and paste from an image to other image
- From: Jens Alfke <email@hidden>
- Date: Sun, 9 May 2010 17:41:37 -0700
On May 9, 2010, at 11:15 AM, Jonathan Chacón wrote:
> I don't know how can I cut a piece of an image and paste it in other image.
Create a new temporary image the size of the selection.
Draw the original image into it, with the source and destination rects set up so the selected area is drawn into the temp image.
Write the temp image into your favorite data format; TIFF or PNG are probably the best choices.
Reset the general pasteboard, declare that data type, and set the data.
Pasting is basically the reverse. Use -[NSImage initWithPasteboard:] to read the pasteboard into an image.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden