Results 1 to 3 of 3

Thread: Polygons

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Oregon
    Posts
    962

    Polygons

    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.
    Involved in: Sentience

  2. #2
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    Here is an example of using the polygon API.....

    VB Code:
    1. Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
    2. Private Type POINTAPI
    3.         x As Long
    4.         y As Long
    5. End Type
    6.  
    7.  
    8. Private Sub Form_Load()
    9.  Dim polypts(6) As POINTAPI
    10.  Dim iNumPts As Integer
    11.  
    12.  Me.AutoRedraw = True
    13.  
    14.  ' create a five sided polygon
    15.  polypts(0).x = 5: polypts(0).y = 10
    16.  polypts(1).x = 35: polypts(1).y = 10
    17.  polypts(2).x = 35: polypts(2).y = 25
    18.  polypts(3).x = 10: polypts(3).y = 25
    19.  polypts(4).x = 2: polypts(4).y = 20
    20.  polypts(5).x = polypts(0).x: polypts(5).y = polypts(0).y
    21.    
    22.  iNumPts = 6
    23.  
    24.  Polygon Me.hdc, polypts(0), 6
    25.  
    26. End Sub
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Oregon
    Posts
    962
    Thanks.
    Involved in: Sentience

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width