Does anyone know how to draw polygons? I know about the polygon api, but I haven't been able to figure out how to use it.
Printable View
Does anyone know how to draw polygons? I know about the polygon api, but I haven't been able to figure out how to use it.
Here is an example of using the polygon API.....
VB Code:
Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long Private Type POINTAPI x As Long y As Long End Type Private Sub Form_Load() Dim polypts(6) As POINTAPI Dim iNumPts As Integer Me.AutoRedraw = True ' create a five sided polygon polypts(0).x = 5: polypts(0).y = 10 polypts(1).x = 35: polypts(1).y = 10 polypts(2).x = 35: polypts(2).y = 25 polypts(3).x = 10: polypts(3).y = 25 polypts(4).x = 2: polypts(4).y = 20 polypts(5).x = polypts(0).x: polypts(5).y = polypts(0).y iNumPts = 6 Polygon Me.hdc, polypts(0), 6 End Sub
Thanks.