Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drawing with clearColor



Probably because when you fill, it is using the SourceOver composite
operation, which is a NOP with clearColor.

D <- S * a + D * (1 - a) translates to D <- 0 * 0 + D * (1 - 0) -or-
D <- D.

I'm not sure how to set the operation using BezierPath, but if you
wanted to have a square hole in your window, I bet this would work.

NSRectFillUsingOperation(theRect, NSCompositeClear);

I would like to know how to change composite modes for use with beziers
as well. I searched and only found references to NSCompositingOperation
in NSGraphics.h (which has the function above), and NSImage, for
compositing images.

How does one, for example, draw an oval which is ATop?

I would expect NSBezierPath to have
fillWithOperation:(NSCompositingOperation)op method.

On Monday, May 28, 2001, at 01:20 PM, Ben Chess wrote:

> Hi,
>
> I've been playing around with the RoundTransparentWindow sample from
> Apple's sample code site. Instead of using NSRectFill() to "paint" in
> the clear background I tried leaving the background solid and making a
> transparent hole in the middle of it. Curiously, when I try
>
> [[NSBezierPath bezierPathWithOvalInRect:theRect] fill]
>
> with clearColor, nothing really happens. Why is this?


References: 
 >drawing with clearColor (From: Ben Chess <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.