Re: Resizing an image
Re: Resizing an image
- Subject: Re: Resizing an image
- From: Ricky Sharp <email@hidden>
- Date: Sat, 21 Jan 2006 18:14:13 -0600
On Jan 21, 2006, at 5:51 PM, Eamon Ford wrote:
How do I resize an image, and make it keep the new size, not just
for drawing? So if I save it to disk and then open it, it'll be
that size. I can't find any methods for doing this. Do I need to
use CoreImage?
Assuming you're working with bitmapped images...
NSImage* theOriginalImage = ...
[theOriginalImage setScalesWhenResized:YES];
[theOriginalImage setSize:theDesiredSize];
Obtain the bitmap rep from the image and call
representationUsingType:properties:. This will obtain an instance of
NSData that can ultimately be written out to a file.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden