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

Re: Transparency?


  • Subject: Re: Transparency?
  • From: John Randolph <email@hidden>
  • Date: Tue, 27 Apr 2004 17:22:26 -0700

On Apr 27, 2004, at 2:41 PM, M. Uli Kusterer wrote:

At 10:19 Uhr -0400 21.04.2004, Huyler, Christopher M wrote:
- (void) drawRect:(NSRect) frame
{
NSRect rect=[self frame];
[super drawRect:frame];
rect.origin=NSMakePoint(1,1);
rect.size.width-=2;
rect.size.height-=2;

[[NSColor colorWithCalibratedWhite:1.0 alpha:0.9] set ];
NSRectFill(rect);
}

IIRC NSRectFill() "assigns" the current color to the pixels of a rect, replacing anything behind them. What you want to do instead is:

[[NSBezierPath bezierPathWithRect: rect] fill];

Simpler solution: NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op).

-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: 
 >Transparency? (From: "Huyler, Christopher M" <email@hidden>)
 >Re: Transparency? (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Reading Java files
  • Next by Date: NSString format specifiers (was: Is Concatenation that complex?)
  • Previous by thread: Re: Transparency?
  • Next by thread: RE: Transparency?
  • Index(es):
    • Date
    • Thread