• 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: subpixel rendering vs. layer backed views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subpixel rendering vs. layer backed views


  • Subject: Re: subpixel rendering vs. layer backed views
  • From: Brandon Walkin <email@hidden>
  • Date: Sun, 8 Feb 2009 00:29:48 -0500

There are a couple tricks you can use to retain subpixel antialiasing. If you're giving the view a layer so you can animate it occasionally, try giving it a layer just before you tell it to animate and removing the layer once the animation is complete. For quick alpha or origin changes, the user won't notice the temporary lack of subpixel rendering.

If the view sits on a constant background, then you can retain subpixel antialiasing while the view is layer backed, provided that it draws a background. Some views (like text fields, for instance) can be configured to draw a background color in Interface Builder. Other views (like the check box you have in your sample project) need to be subclassed to draw a background. Just override -drawRect:, draw your background, and call super. Keep in mind, the background you draw doesn't need to be a flat color. It can be a gradient or some wacky pattern, as long as it's opaque.

-Brandon

On 7-Feb-09, at 10:36 PM, m wrote:

Is it the case that I can have a layer backed view (and thus nice animations), or I can have labels and checkboxes whose text is nicely subpixel anti-aliased, but not both?

I feel like I'm missing something but when I put a check box in a layer backed view, it looks terrible. It's poorly antialiased and there is no subpixel rendering.

Demo at <http://muratnkonar.com/source-code/SubpixelOrLayer.zip>

_murat

_______________________________________________

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

_______________________________________________

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: 
 >subpixel rendering vs. layer backed views (From: m <email@hidden>)

  • Prev by Date: Re: One Shot Windows: WARNING
  • Next by Date: Re: Read lines from very large text file
  • Previous by thread: Re: subpixel rendering vs. layer backed views
  • Next by thread: [Q] NSTextField and binding: What gets called?
  • Index(es):
    • Date
    • Thread