Re: Resizing an image
Re: Resizing an image
- Subject: Re: Resizing an image
- From: Eamon Ford <email@hidden>
- Date: Sat, 21 Jan 2006 18:00:43 -0800
Hmm, that isn't working; when I write the data to a disk, it's still
the same size as before.
From: Ricky Sharp <email@hidden>
To: Eamon Ford <email@hidden>
Cc: Cocoa Dev List Cocoa-Dev <email@hidden>
Date: Sat Jan 21, 2006 04:13:58 PM PST
Subject: Re: Resizing an image
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