Une amélioration du contour avec cette proposition (je ne m'occupe pas du déplacement de la fenêtre).Marc56 a écrit :Question: Est-il possible de faire en sorte que le bord de la découpe bénéficie de ce lissage
Code : Tout sélectionner
EnableExplicit
Declare Start()
Declare Exit()
Start()
Procedure Start()
Protected WinMain, Background, C_Area
Protected TransparentColor = RGB(0, 0, 0), R = 100
WinMain = OpenWindow(#PB_Any, 200, 200, R*2, R*2, "Test", #PB_Window_BorderLess)
Background = CanvasGadget(#PB_Any, 0, 0, R*2, R*2)
;C_Area = CreateEllipticRgn_(0, 0, WindowWidth(WinMain), WindowHeight(WinMain))
;SetWindowRgn_(WindowID(WinMain), C_Area, #True)
;DeleteObject_(C_Area)
SetWindowLong_(WindowID(WinMain), #GWL_EXSTYLE, #WS_EX_LAYERED)
SetLayeredWindowAttributes_(WindowID(WinMain), TransparentColor, 0, #LWA_COLORKEY)
If StartDrawing(CanvasOutput(Background))
Box(0, 0, GadgetWidth(Background), GadgetHeight(Background), TransparentColor)
StopDrawing()
EndIf
If StartVectorDrawing(CanvasVectorOutput(Background))
MovePathCursor(R, R)
AddPathCircle(R, R, R, 0, 360)
ClosePath()
VectorSourceColor(RGBA(0, 128, 128, 255)) ;Couleur de remplissage
FillPath()
StopVectorDrawing()
EndIf
BindEvent(#PB_Event_CloseWindow, @Exit())
Repeat : WaitWindowEvent() : ForEver
EndProcedure
Procedure Exit()
End
EndProcedure