• 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: Rotating image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rotating image


  • Subject: Re: Rotating image
  • From: Jerry Krinock <email@hidden>
  • Date: Sun, 26 Jul 2009 05:05:40 -0700


On 2009 Jul 26, at 01:00, Agha Khan wrote:

Now suppose I want to rotate that image at 90 degree. Is there an easy way to accomplish this task?

Easy, yes. (Just copy Steve Christensen's code ... it works) http://www.cocoabuilder.com/archive/message/cocoa/2009/3/1/231362

Here's the header file for that category:
#import <Cocoa/Cocoa.h>

@interface NSImage (Transform)

/*!
 @brief    Rotates an image around its center by a given
 angle in degrees and returns the new image.

 @details  The width and height of the returned image are,
 respectively, the height and width of the receiver.

 I have not yet tested this with a non-square image.
*/
- (NSImage*)imageRotatedByDegrees:(CGFloat)degrees ;

@end


Two more solutions from Douglas Welton: http://www.cocoabuilder.com/archive/message/cocoa/2009/3/2/231366 _______________________________________________

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: 
 >Rotating image (From: Agha Khan <email@hidden>)

  • Prev by Date: Re: NSButton setImage in runtime : where is template image?
  • Next by Date: My app controller knows it orientation view but sub-views don't
  • Previous by thread: Rotating image
  • Next by thread: Re: Rotating image
  • Index(es):
    • Date
    • Thread