SreenRes gfx_shaped_windows transparent color

Forum for discussion about the documentation project.
Tourist Trap
Posts: 2287
Joined: Jun 02, 2015 16:24

SreenRes gfx_shaped_windows transparent color

Postby Tourist Trap » Mar 26, 2017 19:41

Hello,

I don't find where I've already said that so I suppose I just never did it before. There seems to be a mistake at screenres page with the gfx_shaped_windows transparent color. It's not RGBA(255,0,255,0), it's RGBA(255,0,255,255) or simply RGB(255,0,255) that also works perfectly.

By the way if the screen depth is not 32 or 24 bits, I wonder if there is a way to set another value as transparency. But I'm just thinking about this while posting. It's not very important, just curiosity.
fxm
Posts: 7741
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

Re: SreenRes gfx_shaped_windows transparent color

Postby fxm » Mar 26, 2017 20:46

For higher depths than 8pp, the transparent color is identified by looking just at the red (255), green (0) and blue (255) components of the color value.
So for 32bpp depth, the additional alpha value can assume any value.
Therefore RGBA(255, 0, 255, 0) is just an example of transparent color for 32 bpp depth.
dodicat
Posts: 4766
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: SreenRes gfx_shaped_windows transparent color

Postby dodicat » Mar 26, 2017 23:39

For screen 8 bits the transparency colour for shaped window is 0

Code: Select all

#include "fbgfx.bi"
width 10,5'mini console
screen 19,8,,FB.GFX_SHAPED_WINDOW
color ,7:cls
screencontrol 100,0,0'window in corner
 
circle(400,300),200,0,,,,f

locate 5,5
print "Press a key"

sleep
fxm
Posts: 7741
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

Re: SreenRes gfx_shaped_windows transparent color

Postby fxm » Mar 27, 2017 6:57

Yes.

An interesting documentation page is :
Internal graphics formats
Tourist Trap
Posts: 2287
Joined: Jun 02, 2015 16:24

Re: SreenRes gfx_shaped_windows transparent color

Postby Tourist Trap » Mar 29, 2017 12:51

Ok, I see now. I've left this affair for now due to a lack of time, but the confusion comes also when you use also the GFX_ALPHA_PRIMITIVES flag. Then well, it can be a little confusing to know when you will create a transparency at the whole application level (a hole if it's a filled circle), or just a layer that will blend with the background. I need more testing.

Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 2 guests