ellipse transparente et contour
Publié : lun. 07/oct./2013 20:48
j'ai cherché à faire ça récemment, alors, je vous poste le code, au cas où 
Une ellipse transparente avec outline et épaisseur > 1 pixel
Code : Tout sélectionner
If OpenWindow(0, 0, 0, 200, 200, "Ellipse transparente", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
s =40 ; diameter
If CanvasGadget(1,0,0,200,200)
EndIf
If CreateImage(0, 200, 200, 32,#PB_Image_Transparent) And StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_AlphaBlend)
Ellipse(100 , 100 , s , s , RGBA(0,0,0, 255))
DrawingMode(#PB_2DDrawing_AlphaChannel)
Ellipse(100 , 100 , s -5, s-5 , RGBA(0,0,0, 0))
StopDrawing()
EndIf
If StartDrawing(CanvasOutput(1))
Box(0, 0, 200, 200, RGBA(120,120,120, 255))
DrawingMode(#PB_2DDrawing_AlphaBlend)
DrawAlphaImage(ImageID(0), 0, 0, 255)
StopDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf