Thanks skidracer, but that doesn't seem to work.
In all my tests the alpha byte is always $FF.
Changing the last argument of SetClsColor2 seems to have no effect on the backbuffer.
Here is a small example:
loading the saved image in photoshop or a hex editor shows that no alpha was preserved from the back buffer.
Is there any way at all to get alpha from the back buffer?????
In all my tests the alpha byte is always $FF.
Changing the last argument of SetClsColor2 seems to have no effect on the backbuffer.
Here is a small example:
Const Image$ = "good1.tga" Graphics 800,600,32,0 Function SetClsColor2( red,green,blue,alpha=255 ) glClearColor red/255.0,green/255.0,blue/255.0,alpha/255.0 End Function Global TestImage:tImage = LoadImage(Image$) SetClsColor2(0,0,0,0) SetBlend(ALPHABLEND) While Not KeyHit(KEY_ESCAPE) Cls SetAlpha(0.8) SetScale 0.5,0.5 DrawImage(Testimage,MouseX(),MouseY()) If KeyHit(KEY_BACKSPACE) Then saveTGA("Testsave.tga",GrabPixmap(0,0,800,600),800,600) End If Flip Wend Function SaveTGA(Name$,PM:tPixmap,W,H) Local f,width%,height%,x%,y% Local pix,IR,IG,IB,alpha f=WriteFile(name$) WriteByte(f,0) 'idlength WriteByte(f,0) 'colormaptype WriteByte(f,2) 'imagetype 2=rgb WriteShort(f,0) 'colormapindex WriteShort(f,0) 'colormapnumentries WriteByte(f,0) 'colormapsize WriteShort(f,0) 'xorigin WriteShort(f,0) 'yorigin WriteShort(f,w) 'width WriteShort(f,h) 'height WriteByte(f,32) 'pixsize WriteByte(f,8) 'attributes For y=H-1 To 0 Step -1 For x=0 To w-1 pix = ReadPixel(PM,X,Y) WriteInt(f,pix) Next Next CloseFile(f) End Function
loading the saved image in photoshop or a hex editor shows that no alpha was preserved from the back buffer.
Is there any way at all to get alpha from the back buffer?????