Page 1 of 1
Box command and Alphachannel
Posted: Thu Feb 24, 2011 9:06 pm
by Allanon
Hello,
I've noticed that creating a brush with alphachannel (using flag Alphachannel = True) and then using the Box command in the brush with an ARGB fill color, the command erases the alphachannel.
Using lines with the same ARGB color works fine, maybe Box command can't do this operation?
Re: Box command and Alphachannel
Posted: Sat Feb 26, 2011 11:26 am
by airsoftsoftwair
Hmm, what exactly are you trying to do?
Box() will fill the specified rectangular area in the alpha channel with the alpha value specified in
SetAlphaIntensity(). The alpha channel will only be "erased" if the alpha intensity is set to 0.
Re: Box command and Alphachannel
Posted: Sat Feb 26, 2011 11:09 pm
by Allanon
Ok, here is an example:
Code: Select all
Local b = CreateBrush(Nil, 100, 100, #WHITE, { Alphachannel = True, Clear = True })
SelectBrush(b, #SELMODE_COMBO)
SetFillStyle(#FILLCOLOR)
Box(0, 0, 100, 100, $88FF0000)
EndSelect
DisplayBrush(b, 0, 0)
The above code will overwrite completely what's in the background, while the following code:
Code: Select all
Local b = CreateBrush(Nil, 100, 100, #WHITE, { Alphachannel = True, Clear = True })
SelectBrush(b, #SELMODE_COMBO)
For Local i = 0 To 100
Line(0, i, 100, i, $88FF0000)
Next
EndSelect
DisplayBrush(b, 0, 0)
...preserves the transparency, so I can see what's in the background like it should, seems that the Box() command remove the alphachannel of the brush
Re: Box command and Alphachannel
Posted: Sun Feb 27, 2011 12:06 pm
by airsoftsoftwair
Um, yeah, this is a bug then

I'll fix it. Thanks for the report!
Re: Box command and Alphachannel
Posted: Sun Feb 27, 2011 9:57 pm
by Allanon
Great! I was going mad trying to figure out what was the problem
