• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Scaling an NSImage non-destructively
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: code indenting
  • Next by Date: Hex Edit controls
  • Previous by thread: code indenting
  • Next by thread: RE: Scaling an NSImage non-destructively
  • Index(es):
    • Date
    • Thread