Box command and Alphachannel

Report any Hollywood bugs here
Post Reply
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Box command and Alphachannel

Post 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?
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5871
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Box command and Alphachannel

Post 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.
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Box command and Alphachannel

Post 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
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5871
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Box command and Alphachannel

Post by airsoftsoftwair »

Um, yeah, this is a bug then :) I'll fix it. Thanks for the report!
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Box command and Alphachannel

Post by Allanon »

Great! I was going mad trying to figure out what was the problem :)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
Post Reply