• 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: Drawing an image as hilighted?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Drawing an image as hilighted?
      • From: Ricky Sharp <email@hidden>
References: 
 >Re: Drawing an image as hilighted? (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Drawing an image as hilighted?
  • Next by Date: Re: help with data browser?
  • Previous by thread: Re: Drawing an image as hilighted?
  • Next by thread: Re: Drawing an image as hilighted?
  • Index(es):
    • Date
    • Thread