Re: Quality of icons in table view
Re: Quality of icons in table view
- Subject: Re: Quality of icons in table view
- From: Austin Sarner <email@hidden>
- Date: Thu, 3 Nov 2005 13:23:42 -0500
Thanks for the reply. I went ahead and subclassed NSImageCell,
forcing it to scale the image. It works, but it seems overly verbose
for such a trivial issue -- I'm surprised there isn't a better way of
handling this.
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[[self image] lockFocus]; {
[[self image] setFlipped:YES];
[[self image] setScalesWhenResized:YES];
[[self image] setSize:(NSSize){16.0,16.0}];
} [[self image] unlockFocus];
[[self image] drawAtPoint:(NSPoint){cellFrame.origin.x -= ([[self
image] size].width / 2.0 - cellFrame.size.width /
2.0),cellFrame.origin.y} fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:1.0];
}
––––––––––––
Austin Sarner
On Nov 3, 2005, at 1:02 PM, Stephane Sudre wrote:
On 3 nov. 05, at 17:50, Austin Sarner wrote:
Hey,
I have a table view with a column I use to display some 16x16
icons based on paths. I use bindings and a value transformer to
grab the image for the bound path, cache it, and return it --
displaying it in the image view. All works fine, the correct icon
displays in the column -- but it looks horrible. It looks like it
was scaled with no quality at all.
Now, the weird thing is that when I switch the content view of the
window containing this table view back and forth (it's part of a
preferences thing), the icon quality increases and looks just as
good as the Finder's. Is there some magic refresh method that is
being called when switching panes that I could call manually to
have it look good initially? Any suggestions?
You may have to write some code to get the appropriate
representation for the icon (basically the smallest one). From what
I've seen with NSImageView / NSImageCell, you can't trust it to use
the best representation by itself (example includes the Internet
Explorer icon which was incorrectly rendered depending on weather
conditions, OS version and weekly sports results).
_______________________________________________
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