• 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
Erasing drawn content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Erasing drawn content


  • Subject: Erasing drawn content
  • From: Matej Bukovinski <email@hidden>
  • Date: Tue, 8 Jun 2010 14:32:04 +0200

Hi,

In a cocoa application that I'm developing I have a custom NSView subclass that I use as an overlay view for annotating a WebView. The overlay view draws semi-trasparent rectangles in its drawRect: method for DOM elements that were selected by the user.

Since the fill color for the drawn rectangles is semi-transparent, the pixel values get added up when a smaller rectangle is drawn over a larger one (here's an example http://cl.ly/4fecb8fac0abff6ef6ac , as you can see the smaller rectangle has a darker background because of the larger rectangle, that was drawn first). This is especially problematic if the rectangles are of different colors, since color mixing occurs.

I would like to prevent this sort of behavior by somehow "erasing" the content that was perviously drawn (i.e., making the background transparent again) before drawing with a new element. Does anyone have an idea how to achieve this?

Thank you for your time.

Best regards,
Matej

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Erasing drawn content
      • From: Steve Christensen <email@hidden>
  • Prev by Date: MacTech Conference 2010: Call for Speakers
  • Next by Date: Re: Activating application raises windows meant to be invisible
  • Previous by thread: MacTech Conference 2010: Call for Speakers
  • Next by thread: Re: Erasing drawn content
  • Index(es):
    • Date
    • Thread