• 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
erase then draw image?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

erase then draw image?


  • Subject: erase then draw image?
  • From: matt neuburg <email@hidden>
  • Date: Wed, 16 Oct 2002 11:30:29 -0700

I'm trying to do something very simple - draw a watermark (some transparent text, slightly rotated) into an NSView.

My approach is to set up the text beforehand by drawing it into an NSImage. My NSView's coordinate system is slightly rotated. In my NSView's drawRect I then say simply:

[image drawInRect: dest
fromRect: wholeThing
operation: NSCompositeSourceOver fraction:0.2];

This works great except that every time drawInRect is called, my watermark gets darker and darker until finally it is opaque. It seems what I need to do is somehow flush or clear my NSView each time before I draw. But I can't find a command to do this: NSEraseRect fills it with white, drawing with clearColor fills it with black. How do I do it? Thx - m.

matt neuburg, phd = email@hidden, http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
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.

  • Prev by Date: Re: non-live window resizing
  • Next by Date: Re: [ANN] vcard 0.1 alpha
  • Previous by thread: Re: A CFStringRef that throws EXC_BAD_ACCESS
  • Next by thread: erase then draw image?
  • Index(es):
    • Date
    • Thread