• 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
NSImage scaling and ugliness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage scaling and ugliness


  • Subject: NSImage scaling and ugliness
  • From: "Stephen F. Booth" <email@hidden>
  • Date: Mon, 10 Jul 2006 11:42:13 -0700

I am working on a view that contains an NSTableView displaying a list of files. I want to display the file's icon and the last component of the pathname. Rather than implement a custom subclass of NSTextFieldCell or NSImageCell (like ImageAndTextCell), I chose to just use a table with two columns. The first is 16 pixels wide for the icon and the second holds the filename. Everything works properly, but some of the icons when scaled to 16x16 look terrible when compared to the similar view in Finder. I've posted a screenshot of the two windows at http://img354.imageshack.us/ img354/3091/picture14fn.png

My code for grabbing the icon looks like:

NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:filename];
[icon setSize:NSMakeSize(16, 16)];

I have tried setting the scalesWhenResized property, with identical results. The icons that aren't pretty are mainly ones that have no 16x16 representation, but since Finder can display them I assume there is something I'm not doing.

Does one have to use CoreGraphics to get good scaling?

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
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

  • Follow-Ups:
    • Re: NSImage scaling and ugliness
      • From: Christian Walther <email@hidden>
  • Prev by Date: ANN: CamelBones 1.0
  • Next by Date: Re: NSWindows/NSPanels/NSDrawers are NIL
  • Previous by thread: ANN: CamelBones 1.0
  • Next by thread: Re: NSImage scaling and ugliness
  • Index(es):
    • Date
    • Thread