• 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: NSImageView frames
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView frames


  • Subject: Re: NSImageView frames
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Sun, 28 Dec 2003 15:30:02 +0100

At 15:41 Uhr -0500 27.12.2003, Devon E Bowen wrote:
My image changes. It gets more transparent based on the settings of
a slider. So I have a drawRect method that composites the image as
needed. Or is there a better way to do that than subclassing
NSImageView? As someone pointed out, I was just missing the call to
[super drawRect] and now it seems to work fine.

The problem is that drawRect also draws the image. Which means your code can draw as transparent as it likes, the superclass's drawRect: will obliterate anything that would show through. The only thing you'll see will be a 100% opaque image.

I think what you really want is to create a new NSImage, in which you do your drawing, and then assign that NSImage to the NSImageView using setImage.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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: NSImageView frames (From: Devon E Bowen <email@hidden>)

  • Prev by Date: Re: Duh (NSTextView & Word Wrapping)
  • Next by Date: Re: How do I know the screensaver is active?
  • Previous by thread: Re: NSImageView frames
  • Next by thread: Re: NSImageView frames
  • Index(es):
    • Date
    • Thread