Re: Transparency?
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.