• 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: How to scale an NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to scale an NSImage


  • Subject: Re: How to scale an NSImage
  • From: Peter Fischer <email@hidden>
  • Date: Sun, 24 Aug 2003 09:29:24 -0400

Tito -
After creating your image, pass it a set scales when resized message, and change the size:

NSImage *myImage = [however you allocated it]
[myImage setScalesWhenResized:YES];

NSSize newSize;
newSize.width = 64;
newSize.height = 64;
[myImage setSize:newSize];

The only thing I have seen with the scaling is that it pretty much only works one way. An NSImage will scale very well from large to small, but scales poorly from small to large, and ends up being blurry. I find that going from small to large, its just better to reload the image.

--Pete

On Sunday, August 24, 2003, at 04:43 AM, Tito Ciuro wrote:

Hello,

I have a 128 x 128 image which I'd like to scale at 64 x 64. Any ideas?

Thanks!

-- Tito
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >How to scale an NSImage (From: Tito Ciuro <email@hidden>)

  • Prev by Date: Subject: Help me, which book I should buy to learn Cocoa??
  • Next by Date: Re: Synchronous method: How to "wait" for Notification to occur?
  • Previous by thread: How to scale an NSImage
  • Next by thread: Subject: Help me, which book I should buy to learn Cocoa??
  • Index(es):
    • Date
    • Thread