discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing transparent images?


From: Björn Giesler
Subject: Re: Drawing transparent images?
Date: Mon, 03 Nov 2003 08:03:59 +0100

Hi,

On 2003-11-02 18:46:33 +0100 Alexander Malmberg <address@hidden> wrote:
> How do you check what you got in the image?

I'm using the image (perhaps a bit naively) for -[NSView 
dragImage:at:offset:...]. I just supposed that since images read from TIFF 
files can be dragged with transparency, the same is valid for self-drawn images.

>>    [[NSColor clearColor] set];
>>    NSRectFill(NSMakeRect(0, 0, size.width, size.height));
> This is a noop. Drawing an invisible rectangle doesn't change the
> contents of the buffer. What you want is probably:
> 
> NSRectFillUsingOperation(NSMakeRect(...), NSCompositeClear);

Point taken. This *seems* to work if the backend doesn't handle transparent 
dragging of self-drawn images (I get black patches where the transparency 
should be). However, filling the rect with clearColor set and NSCompositeCopy 
gives me a lightgray rect.

> back-art doesn't do text drawing in buffers with alpha (ie. the alpha
> channel is ignored, which causes problems).

I'm not using back-art, just plain old gnustep-back. However, to reduce 
problems, I'll be taking the alpha out for now.

Regards & thanks,
Björn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]