Re: Rotating image
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