• 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: Unwanted transparency in custom view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unwanted transparency in custom view


  • Subject: Re: Unwanted transparency in custom view
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 17 Jun 2002 13:47:02 -0700

On Monday, June 17, 2002, at 12:43 PM, Gregory Weston wrote:

Ken Tozier <email@hidden> writes:

I'm writing a custom view class and have everything working except for
one bug, when it renders it is semi transparent. I overrode "isOpaque"
to return yes and set the color alpha to 1.0 but you can still see
through it.

I may be mistaken, but I'm under the impression that overriding isOpaque to
return YES is a performance optimization that tells the system not to bother
redrawing the window surface because you're going to completely overwrite
it anyway. It's not a signal that the system should somehow erase any
areas you don't explicitly draw, which it sounds like you were expecting.

That is correct.

Basically, returning YES from -isOpaque is a promise that you'll cover every pixel you're asked to in -drawRect:.

-jcr


John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Unwanted transparency in custom view (From: Gregory Weston <email@hidden>)

  • Prev by Date: Re: Protecting Software w/ Software License
  • Next by Date: Double-click on link
  • Previous by thread: Re: Unwanted transparency in custom view
  • Next by thread: Rotated display of bitmap images?
  • Index(es):
    • Date
    • Thread