Option Explicit
Private Type COORD
x As Long
y As Long
End Type
Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As Any, ByVal nCount As Long) As Long
Private Sub Poly(ByVal numVert As Long, ByVal sizeFactor As Long, Optional ByVal rotateGrad As Long = 0)
Dim p() As COORD, i As Long
Dim tmp As Double, curgr As Double
ReDim p(1 To numVert)
tmp = 2 * 3.1415926536 / numVert
curgr = -tmp + rotateGrad * 3.1415926536 / 180
For i = 1 To numVert
curgr = curgr + tmp
p(i).x = Cos(curgr) * sizeFactor + sizeFactor
p(i).y = Sin(curgr) * sizeFactor + sizeFactor
Next
Polygon Me.hdc, p(1), numVert
End Sub
Private Sub Timer1_Timer()
Static rot As Long
rot = rot + 1
Me.Cls
Poly 3, 200, rot
End Sub
Сейчас этот форум просматривают: Majestic-12 [Bot] и гости: 117