Re: NSRectFill not supporting compositing?????
Re: NSRectFill not supporting compositing?????
- Subject: Re: NSRectFill not supporting compositing?????
- From: Buddy Kurz <email@hidden>
- Date: Tue, 20 May 2003 08:45:24 -0700
On Tuesday, May 20, 2003, at 07:32 AM, Stiphane Sudre wrote:
On mardi, mai 20, 2003, at 16:24 Europe/Paris, Quentin Mathi wrote:
Le mardi, 20 mai 2003, ` 14:11 Europe/Paris, Stiphane Sudre a icrit :
I just discovered that NSRectFill was not supporting compositing.
i.e. if you have an alpha component on a NSColor, it's not taken
into account.
As this behavior is not described in the NSRectFill documentation
which is just stating:
Fills the passed rectangle with the current color.
Is this an imprecision in the documentation or a bug in NSRectFill?
You cannot do alpha drawing directly into a NSView with NSRectFill
You must use an NSImage to do it like that for example :
@implementation TheView
[...]
@end
To be more general we can said that the compositing support directly
in an NSView doesn't work very well (you get strange results in many
cases, I don't know why, I don't know if it's normal), the solution
is to use an intermediate NSImage to do special compositing with
composite operations
I must say I'm curious to know if in the future we will be able to
do rendering directly in NSView with whatever composite operations.
Currently, I'm using:
[[NSBezierPath bezierPathWithRect:myRect] fill];
It's a bit easier and faster.
But as I thought that NSRectFill was just a kind of shortcut for the
code above, I'm a bit surprised by the different behavior I'm seeing.
I am also using NSBezierPath but I understand the following also works:
NSRectFillUsingOperation(rect, NSCompositeSourceOver);
Anybody know which is faster?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.