• 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 text with alpha
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing text with alpha


  • Subject: Re: Drawing text with alpha
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 21 Aug 2007 21:54:46 -0400

On Aug 21, 2007, at 9:17 PM, Phil wrote:
Sorry, I should have been more specific: I need the text background to be semitransparent not completely transparent.



I haven't done (what I believe is) exactly what you're trying to do but I've approached the problem (in the situation where I wanted a semitransparent background) as two separate items:

1 - Background "bezel" (think volume controls) consisting of a filled rect or rounded rect (many code examples for this).

 ... and ...

2 - Text.

The text formatting you would be "sans background", but before you draw the text, draw your bezel. If you treat the items separately, you should get what you're looking for. I've never encountered issues approaching the problem this way (and it's honestly never occurred to me to use NSBackgoundColorAttributeName -- I don't even remember that particular attribute name :-) ). Perhaps it's (your alpha problems) simply a limitation / consequence of using the text system versus "raw drawing" atop an existing view.

Again, it's getting late for me after an entire work-day of dealing with drawing-related code in my own project and I've had a few beers tonight at a celebratory party to top it off, so I may be completely missing something. Apologies in advance if this turns out to be the case. ;-)

--
I.S.  ("who drinks *socially*, kids!")


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Drawing text with alpha (From: Phil <email@hidden>)
 >Re: Drawing text with alpha (From: "I. Savant" <email@hidden>)
 >Re: Drawing text with alpha (From: Phil <email@hidden>)

  • Prev by Date: Series of sheets
  • Next by Date: Re: Series of sheets
  • Previous by thread: Re: Drawing text with alpha
  • Next by thread: Re: Drawing text with alpha
  • Index(es):
    • Date
    • Thread