Private Sub Form_Load()
Dim Jouer(0 To 2) As POINTAPI
Dim CerclePlay As Long
Dim CerclePlayTrou As Long
Dim TrianglePlay As Long
Dim Final As Long
CerclePlay = CreateEllipticRgn(400, 40, 500, 140)
CerclePlayTrou = CreateEllipticRgn(405, 65, 495, 115)
Jouer(0).X = 440: Jouer(0).Y = 70
Jouer(1).X = 440: Jouer(1).Y = 110
Jouer(2).X = 470: Jouer(2).Y = 90
TrianglePlay = CreatePolygonRgn(Jouer(0), 3, 1)
Final = CreateRectRgn(0, 0, 800, 800)
CombineRgn CerclePlay, CerclePlay, CerclePlayTrou, RGN_DIFF
CombineRgn CerclePlay, CerclePlay, TrianglePlay, RGN_OR
CombineRgn Final, CerclePlay, Final, RGN_AND
SetWindowRgn Me.hWnd, Final, True
Me.Refresh
End Sub
/* dans le module
Type POINTAPI
X As Long
Y As Long
End Type
Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Declare Function SetWindowRgn Lib "User32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Public Const RGN_AND = 1
Public Const RGN_OR = 2
Public Const RGN_XOR = 3
Public Const RGN_DIFF = 4
*/
Enfin ça va être dur de vérifier... essaye d'y appliquer une image et de changer d'ordi...
---------------
Telle corne tel boeuf, tel mot tel homme.