Fantom

Login | Register

Default Image.makePainted background to transparent #1938

SlimerDude
4 Jul 2012

When creating an Image with gfx::Image#makePainted how do I set (or make) a pixel transparent?

I can't use

g.brush = Color(argb)
g.fillRect(x, y, 1, 1)

because that draws a pixel with alpha, it doesn't set the alpha on the image

I've also messed around with gfx::Graphics#alpha whilst drawing, but it doesn't seem to do much different.

andy
5 Jul 2012

SWT or JS? JS has an API to clear a region of the buffer - haven't looked at SWT though - if it does too - we should be able to add a method to Graphics for that.

SlimerDude
6 Jul 2012

It was the SWT version I was looking at, with a view of porting it to JS later. What's the JS API you mention?

andy
6 Jul 2012

clearRect

SlimerDude
22 Jul 2012

The following says you can set a particular colour to be transparent:

Taking a look at SWT Images

Perhaps we could have a method to set the entire image to be transparent - or maybe the image could be transparent when it is first initialised?

andy
22 Jul 2012

gfx::Image#makePainted ... or maybe the image could be transparent when it is first initialized

I didn't realize this wasn't already the case - we should fix that.

andy
20 Aug 2012

The following says you can set a particular colour to be transparent:

Really want that to be a full alpha channel - scanned that article - not sure if they we can do that or not. Lets open though - we should be able to fix somehow - patches welcome if you want to take a look.

andy
20 Aug 2012

Promoted to ticket #1938 and assigned to andy

andy
20 Aug 2012

Renamed from Setting Transparent Image Pixels to Default Image.makePainted background to transparent

Login or Register to Reply

Back | All Topics