• 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: Rotate NSImage to get a new NSImage, without drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rotate NSImage to get a new NSImage, without drawing


  • Subject: Re: Rotate NSImage to get a new NSImage, without drawing
  • From: Graham Cox <email@hidden>
  • Date: Sun, 1 Mar 2009 15:10:40 +1100


On 01/03/2009, at 2:31 PM, Jerry Krinock wrote:

I understand that NSAffineTransform can rotate an image while you're drawing it. But is there any way to rotate an image and get a new image? Something like:

NSImage* imageUp = [NSImage imageNamed:@"BaseImage"] ;
NSImage* imageLeft = [imageUp myRotateByDegrees:90] ;
...

How could I implement -[NSImage myRotateByDegrees] ?


Create the new image, swapping width and height, lock focus onto it, apply a transform that rotates 90 degrees, and draw the first into the second.

You can't do it without drawing, but the drawing doesn't need to be onscreen.

--Graham


_______________________________________________

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


  • Follow-Ups:
    • Re: Rotate NSImage to get a new NSImage, without drawing
      • From: Jerry Krinock <email@hidden>
References: 
 >Rotate NSImage to get a new NSImage, without drawing (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Rotate NSImage to get a new NSImage, without drawing
  • Next by Date: Re: Rotate NSImage to get a new NSImage, without drawing
  • Previous by thread: Rotate NSImage to get a new NSImage, without drawing
  • Next by thread: Re: Rotate NSImage to get a new NSImage, without drawing
  • Index(es):
    • Date
    • Thread