Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function PolyBezier Lib "gdi32.dll" _
(ByVal hdc As Long, lpPoint As Any, ByVal cPoints As Long) As Long
Private Sub Form_Load()
Me.Picture1.ScaleMode = 3
Me.Picture1.BackColor = vbWhite
End Sub
Private Sub Picture1_Paint()
Dim lpPoints(6) As POINTAPI
Dim dx, dy
dx = Me.Picture1.ScaleWidth
dy = Me.Picture1.ScaleHeight
Me.Picture1.ForeColor = vbRed
Randomize
For a = 0 To UBound(lpPoints)
lpPoints(a).x = dx * Rnd: lpPoints(a).y = dy * Rnd
Next
Call PolyBezier(Me.Picture1.hdc, lpPoints(0), 7)
End Sub |