Il suffit simplement de dessiner plusieurs fois le rectangle.
Enfin, quand je dis simplement, c'est le cas pour les Box mais pas pour les RoundBox ou j'ai du compliquer le code pour éviter les blanc dans la zone arrondi.
Code : Tout sélectionner
; Auteur : Le Soldat Inconnu
; Version de PB : 4.50
;
; Explication du programme :
; Pour faire des programmes de test rapidement, il ne reste qu'a rajouter les gadgets et la gestion des évènements.
Procedure FatBox(x, y, Width, Height, Fat, Color)
For i = 1 To Fat
Box(x + i, y + i, Width - 2 * i, Height - 2 * i, Color)
Next
EndProcedure
Procedure FatRoundBox(x, y, Width, Height, RoundX, RoundY, Fat, Color)
For i = 1 To Fat
RoundBox(x + i, y + i, Width - 2 * i, Height - 2 * i, RoundX, RoundY, Color)
RoundBox(x, y + i, Width, Height - 2 * i, RoundX, RoundY, Color)
RoundBox(x + i, y, Width - 2 * i, Height, RoundX, RoundY, Color)
If i > 1
RoundBox(x + i - 1, y + i, Width - 2 * i + 2, Height - 2 * i, RoundX, RoundY, Color)
RoundBox(x + i, y + i - 1, Width - 2 * i, Height - 2 * i + 2, RoundX, RoundY, Color)
EndIf
Next
EndProcedure
; Création de la fenêtre et de la GadgetList
If OpenWindow(0, 0, 0, 500, 300, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget) = 0
End
EndIf
CreateImage(0, 500, 300, 32 | #PB_Image_Transparent)
StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_AlphaBlend | #PB_2DDrawing_Outlined | #PB_2DDrawing_Transparent)
FatBox(10, 10, 60, 90, 5, $FF5099FF)
FatRoundBox(100, 10, 100, 120, 40, 20, 10, $FFFF99FF)
StopDrawing()
ImageGadget(0, 0, 0, 500, 300, ImageID(0))
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu() ; Menus
EndSelect
Case #PB_Event_Gadget
Select EventGadget() ; Gadgets
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow