Re: Getting a file's icon > 32x32 (Solved)
Re: Getting a file's icon > 32x32 (Solved)
- Subject: Re: Getting a file's icon > 32x32 (Solved)
- From: Rainer Brockerhoff <email@hidden>
- Date: Tue, 29 Jan 2002 17:30:48 -0200
At 11:15 -0800 29/01/2002, Brant Vasilieff wrote:
>
On Monday, January 28, 2002, at 04:48 PM, email@hidden wrote:
>
>
>look at the imageReps inside the NSImage... there are typically several. you have to look for the 128x128 one.
>
>
>
>
Thanks. The reps appear to be sorted in descending order. Don't know if it's guaranteed, but it looks reliable enough with one file, to let me experiment.
I _think_ you shouldn't rely on the reps being in any particular order.
>
I can get the correct imageRep and draw it, but that opens up a whole new can of worms. I'm drawing within a NSBrowserCell subclass which resides in a NSMatrix. In order to get the matrix to place cell top to bottom instead of bottom to top, it is necessary to flip the coordinates in NSMatrix. That causes the image to draw upside down. Ok, I can call setFlipped: on the image to correct it. Unfortunately that doesn't work for image reps.
In the SimpleBrowser example, there's code to correct for flipped controlViews in the NSBrowserCell drawing method...
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"I love deadlines. I love the whooshing noise they make as they go by" (Douglas Adams)
http://www.brockerhoff.net/ (updated Jan. 2002)