| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 27. Jun 2004, at 2:06, Jerry LeVan wrote:_______________________________________________
About all I can do is produce "kaleidoscopes"...
NSSize imageSize; // Size of the image to draw
NSSize scaledRect;
NSImage *tmpImage=NULL;
float scaleFactor=[theSlider floatValue];
tmpImage = [anImage copy];
I think this should be:
tmpImage = [[NSImage alloc] initWithSize:imgSize];
Where imgSize should probably be (if you also wanted to scale):
NSSize imgSize = [anImage size];
imgSize.width = ceilf(imgSize.width * scaleFactor);
imgSize.height = ceilf(imgSize.height * scaleFactor);
Because you want a blank image to draw the rotated version into (by using copy you basically draw on top of the old image).
Btw: the save/restore graphics context is not necessary, since a new context is setup when you send lockFocus to the image.
| References: | |
| >Rotating Images.... (From: Jerry LeVan <email@hidden>) | |
| >Re: Rotating Images.... (From: Allan Odgaard <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.