• 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
Re: Resizing an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Resizing an image (From: Eamon Ford <email@hidden>)
 >Re: Resizing an image (From: Ricky Sharp <email@hidden>)

  • Prev by Date: PDFView not displaying PDFDocument
  • Next by Date: location of text in NSTextView
  • Previous by thread: Re: Resizing an image
  • Next by thread: Re: Resizing an image
  • Index(es):
    • Date
    • Thread