Re: Transparent fill, opaque stroke
Re: Transparent fill, opaque stroke
- Subject: Re: Transparent fill, opaque stroke
- From: Stéphane Sudre <email@hidden>
- Date: Tue, 23 Oct 2001 14:10:16 +0200
On lundi, octobre 22, 2001, at 08:22 , j o a r wrote:
On Monday, October 22, 2001, at 07:19 , Ken Tabb wrote:
Me again,
;)
is it possible to draw a closed NSBezierPath such that its outline is
100% black opaque, but its fill (i.e. the inside of the loop) is 50%
transparent?
Have you tried it and it doesn't work?
Something like:
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.5] set];
[myPath fill];
[[NSColor blackColor] set];
[myPath setLineWidth:1.0];
[myPath stroke];
An additional potential idea:
NSGraphicsContext *graphicsContext;
CGContextRef windowContext;
graphicsContext = [NSGraphicsContext currentContext];
windowContext = [graphicsContext graphicsPort];
CGContextSetRGBFillColor(windowContext, 0,0,0, 0.5);
CGContextSetRGBStrokeColor(windowContext, 0,0,0, 1);