image and pixel

Blitz3D Forums/Blitz3D Beginners Area/image and pixel

Prym(Posted 2014) [#1]
hello blitzbasic fans,
hear's a problem .
Alpha information are lost or deleted.
why this code does not he work?
I don't know .

Global NBtest% = $23DEDEDE , colorpixel% = $00000000
Global image% = 0 , buffimage% = 0
Graphics3D 400 , 200
image = LoadImage ( "kaleid.png" )
buffimage = ImageBuffer ( image )
colorpixel = ReadPixel ( 100 , 100 , buffimage )
Print "colorpixel = ReadPixel"
Print
Print "Hex$ ( NBtest ) = " + Hex$ ( NBtest )
Print "Hex$ ( colorpixel ) = " + Hex$ ( colorpixel )
WaitKey ( )
If colorpixel = NBtest Then
Print
Print "OK !"
Else
Print "WritePixel NBtest"
WritePixel ( 100 , 100 , NBtest , buffimage )
SaveBuffer ( buffimage , "kaleid.png" )
EndIf
WaitKey ( )
End

Do you want to try it ,
and give me any explanation .
Thank you .


Yasha(Posted 2014) [#2]
LoadImage doesn't support alpha, simple as that. There is no alpha support in the entire 2D system - you shouldn't rely on the values read from the alpha channel to even be consistent; they're simply not valid.

If you need a buffer with alpha support, use a texture instead.


Prym(Posted 2014) [#3]
As simple as that !
Certainly thank you, Yasha .
I could think it .