Re: Drawing an image as hilighted?
Re: Drawing an image as hilighted?
- Subject: Re: Drawing an image as hilighted?
- From: Stéphane Sudre <email@hidden>
- Date: Sun, 4 Sep 2005 22:57:13 +0200
On dimanche, septembre 4, 2005, at 10:15 PM, John Stiles wrote:
You can certainly render buttons "by hand" using HIToolbox (part of
the Carbon framework). Without more details I don't know if that would
be appropriate for your situation or not. I don't know if there is a
Cocoa equivalent which lets you request low-level UI object rendering.
Colin Cornaby wrote:
Is there any Apple supplied code to draw an image as hilighted? For
example, the way an image hilights when it's clicked in iPhoto's
bottom toolbar (I know they're buttons which have that functionality
built in, but I'm not using buttons).
If by highlighting, you mean darkened, it's quite easy to achieve IIRC.
- create a new NSImage the size of your image
- lock the new image
- draw your image
- draw a black rectangle with a specific alpha alpha value (0.33f maybe
but YMMV)
- unlock the new image
And then you have your highlighted image.
_______________________________________________
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