Dites-moi, est-il possible de récupérer l'alpha avec un openwindowedscreen(), un screenoutput() et un point() ?
J'ai testé ça mais ça me renvoie toujours 0, pourtant, avec le screenDepth(), j'ai bien une profondeur de 32 (mais peut-être que ça n'a rien à voir). J'imagine que l'écran n'étant pas en 32 bits (car ce n'est pas une surface type image ou autre)
Code : Tout sélectionner
screenwidth = 1024
screenheight = 768
OpenWindow(0, 0, 0, screenwidth, screenheight, "Screen picker", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
InitSprite()
If OpenWindowedScreen(WindowID(0),0,0,screenwidth, screenheight)=0
MessageRequester("Error", "Can't Open Screen!", 0)
End
EndIf
Debug ScreenDepth()
Repeat
Repeat
Event = WindowEvent()
If event = #PB_Event_CloseWindow
quit = 1
EndIf
Until event = 0 Or quit = 1
rx = WindowMouseX(0)
ry = WindowMouseY(0)
ClearScreen(0)
If StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_AlphaBlend)
Box(0,0,screenwidth,screenheight,RGBA(120,120,120,200))
For i = 0 To 3
For j = 0 To 3
Circle(100+i*100,100+j*100,40,RGBA(i*50,j*50,200,50+i*50))
Next j
Next i
If rx>0 And rx<OutputWidth()-1 And ry>0 And ry<OutputHeight()-1
Color1 = Point(rx,ry)
EndIf
Alpha = Alpha(Color1)
DrawText(50,50,Str(alpha))
DrawText(50,100,Str(Color1))
StopDrawing()
EndIf
FlipBuffers()
Until quit = 1