FROM : Andreas Mayer
DATE : Thu Jul 20 00:22:34 2006
Am 19.07.2006 um 16:40 Uhr schrieb Andreas Mayer:
> - (void)drawRect:(NSRect)rect {
> [[NSColor colorWithCalibratedRed:0.f green:0.5f blue:0.f alpha:
> 0.5f] set];
> NSRectFill(rect);
> }
In case someone got the impression it was somehow necessary to fall
back to NSRectFill - here is how to do the same using NSBezierPath:
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithCalibratedRed:0.f green:0.5f blue:0.f alpha:0.5f]
set];
[[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeCopy];
[[NSBezierPath bezierPathWithRect:rect] fill];
}
I just thought NSRectFill was the simpler solution in this case. :)
Andreas
DATE : Thu Jul 20 00:22:34 2006
Am 19.07.2006 um 16:40 Uhr schrieb Andreas Mayer:
> - (void)drawRect:(NSRect)rect {
> [[NSColor colorWithCalibratedRed:0.f green:0.5f blue:0.f alpha:
> 0.5f] set];
> NSRectFill(rect);
> }
In case someone got the impression it was somehow necessary to fall
back to NSRectFill - here is how to do the same using NSBezierPath:
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithCalibratedRed:0.f green:0.5f blue:0.f alpha:0.5f]
set];
[[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositeCopy];
[[NSBezierPath bezierPathWithRect:rect] fill];
}
I just thought NSRectFill was the simpler solution in this case. :)
Andreas
| Related mails | Author | Date |
|---|---|---|
| Michael Lutz | Jul 19, 12:41 | |
| John C. Randolph | Jul 19, 13:27 | |
| Michael Lutz | Jul 19, 14:30 | |
| Stephane | Jul 19, 15:00 | |
| Michael Lutz | Jul 19, 16:10 | |
| Pascal Pochet | Jul 19, 16:33 | |
| Andreas Mayer | Jul 19, 16:40 | |
| Stephane | Jul 19, 16:46 | |
| Michael Lutz | Jul 19, 17:11 | |
| Pascal Pochet | Jul 19, 17:45 | |
| Andreas Mayer | Jul 20, 00:22 |






Cocoa mail archive

