Re: Clearing an NSView
Re: Clearing an NSView
- Subject: Re: Clearing an NSView
- From: "Erik M. Buck" <email@hidden>
- Date: Tue, 24 Jul 2001 16:30:18 -0500
Try
NSRectFillUsingOperation
Fills a rectangle using an NSCompositingOperation.
void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op)
http://gemma.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_c
lassic/Functions/AppKitFunctions.html
use NSCompositeCopy with a transparent color or NSCompositeClear
NSCompositingOperation
Moved from dpsOpenStep.h.
typedef enum _NSCompositingOperation {
NSCompositeClear,
NSCompositeCopy,
NSCompositeSourceOver,
NSCompositeSourceIn,
NSCompositeSourceOut,
NSCompositeSourceAtop,
NSCompositeDestinationOver,
NSCompositeDestinationIn,
NSCompositeDestinationOut,
NSCompositeDestinationAtop,
NSCompositeXOR,
NSCompositePlusDarker,
NSCompositeHighlight,
NSCompositePlusLighter
} NSCompositingOperation;
http://gemma.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_c
lassic/TypesAndConstants/AppKitTypes.html
A better aproach for transparent overlays is to simply not draw areas that
you want to see through. Use clipping and simple selective drawing.