• 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: how to cut and paste from an image to other image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >how to cut and paste from an image to other image (From: "Jonathan Chacón" <email@hidden>)

  • Prev by Date: Re: How to do cancellable HTTP request using CFNetwork APIs
  • Next by Date: simple CATextLayer scaling problem
  • Previous by thread: Re: how to cut and paste from an image to other image
  • Next by thread: simple CATextLayer scaling problem
  • Index(es):
    • Date
    • Thread