Re: NSImage is driving me nuts ! [SOLUTION]
Re: NSImage is driving me nuts ! [SOLUTION]
- Subject: Re: NSImage is driving me nuts ! [SOLUTION]
- From: Jerome Foucher <email@hidden>
- Date: Thu, 02 Dec 2004 11:44:57 +0100
On Thursday, December 02, 2004, at 11:02AM, Jerome Foucher <email@hidden> wrote:
>Hello list,
>
>I'm using NSImages to draw nice badges inside a custom NSCell
>The problem is that the images I use do not draw properly. They seem not to care too much about their mask... Particularily, where the image has a white opaque border (that is, its mask is set so that the border is white), the image is blended inside the cell's background, and the border does not appear white. I use NSCompositeSourceOver for the operation parameter.
>
>What's really driving me nuts is that if I use compositeToPoint:operation: the result is not the same as if I use drawInRect:>fromRect:operation:fraction:
>compositeToPoint:operation: seems to draw the images properly. However, I need to stretch some part of my image, so I can't >use compositeToPoint.....
Ahah. I found the solution myself ! It turns out that when using drawInRect, the current color is used as the image background color. Calling [[NSColor whiteColor] set] before calling [image drawInRect:....] solves my problem.
Sorry for the post, but I already spent several hours on this stupid problem, and I really felt desperate....
Jérome
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden