No warning to mix screen 0 and screen graphic commands!
#5
@DSman
hi thanks for replying

1. _setalpha works on actual image and not to the future changement of it
If this is true I can try to set alpha channel the instant before using _putimage and ths must garantee me to get a half transparent image copied. But this code demonstrates that it is not so.
Code: (Select All)
Dim Shared S1 As Long, S2 As Long ' declaring pointer variables
S1 = _NewImage(1200, 900, 32) ' first image linked to pointer
S2 = _NewImage(1200, 300, 32) ' second image linked to pointer
'_SetAlpha 100, 0, S2  '<--- setting the second image grade of transparency (more than half transparent)
Screen S1 ' it creates screen of application
Paint (1, 1), _RGBA32(0, 50, 100, 256) ' we colour alla screen   with dark blue
_Delay 1 ' it waits a second
_Dest S2 'we direct output to image S2
Print "If you see color back to this text all is ok" ' print on S2 as screen text mode = Screen 0 legacy
_SetAlpha 100, 0, S2 '<--- setting the second image grade of transparency (more than half transparent)
_PutImage (1, 600), S2, S1 'it copies S2 on S1 starting from point X 1 Y 600
No changements if I set before o after PRINT on S2.

[Image: image.png]



Yes PRINT works only with alpha set to 255, indipendently from alpha setting of the image (screen) on which it works.
So you are right I am mixing too much COLOR with _SETALPHA... I must use _RGBA with COLOR to get this fading effect! Text is indipendent from _alpha settings of image!  Run the following code 
Code: (Select All)
Dim Shared S1 As Long, S2 As Long ' declaring pointer variables
S1 = _NewImage(1200, 900, 32) ' first image linked to pointer
S2 = _NewImage(1200, 300, 32) ' second image linked to pointer
'_SetAlpha 100, 0, S2  '<--- setting the second image grade of transparency (more than half transparent)
Screen S1 ' it creates screen of application
Paint (1, 1), _RGBA32(0, 50, 100, 256) ' we colour alla screen   with dark blue
_Delay 1 ' it waits a second
_Dest S2 'we direct output to image S2
Color _RGBA32(255, 255, 255, 100), _RGBA(0, 0, 0, 100)
Print "If you see color back to this text all is ok" ' print on S2 as screen text mode = Screen 0 legacy
_SetAlpha 100, 0, S2 '<--- setting the second image grade of transparency (more than half transparent)
_PutImage (1, 600), S2, S1 'it copies S2 on S1 starting from point X 1 Y 600
and TADA!

[Image: immagine-2023-06-14-143809002.png]
Here Text and its background are fading!

Thanks for your helps, so you suggest me  what to do to go on!
Reply


Messages In This Thread
RE: No warning to mix screen 0 and screen graphic commands! - by TempodiBasic - 06-14-2023, 12:40 PM



Users browsing this thread: 1 Guest(s)