Scaling an NSImage non-destructively
Scaling an NSImage non-destructively
- Subject: Scaling an NSImage non-destructively
- From: Keith Blount <email@hidden>
- Date: Mon, 29 Nov 2004 16:00:04 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
This has had me stumped for some time: can anybody
give me any pointers on how to scale an NSImage in
such a way that if I convert it to data using [image
TIFFRepresentation], its new size is retained without
it losing any data?
I want this so that I can scale an image in my app. I
have found that if I use [image setSize:s], once the
image is saved and restored using TIFFRepresentation,
it returns to its original size - because setSize:
only affects the display. I have been told that
NSBitmapImageRep is the way to go, but I have no idea
how this helps seeing as you init an image rep using
initWithData:[image TIFFRepresentation[ and image reps
have no explicit scaling methods...
At the same time, if I scale an image by locking focus
on it and using drawInRect, if I scale it down and
back up again it becomes blocky because I have lost
lots of data in the process.
Could somebody please point me in the right direction
to creating a new rescaled image from another image
that can be stored and restored using
TIFFRepresentation, that can then be rescaled again
without any loss in quality? I must be missing
something simple here, as I imagine this must be done
quite often...
Many thanks for any help,
Keith
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
_______________________________________________
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