Logo bandeau transparence

GTsoft


Integrem

Documentation

Calendrier

Septembre
LMMJ VSD
  12345
6789101112
13141516171819
20212223242526
27282930   

Administration



Description des APIS Win 32 Utilisées

Polygone


Private Type POINTAPI 'pour Polygon
X As Long
Y As Long
End Type
Private Declare Function Polygon Lib "gdi32" (ByVal hDC As Long, lpoint As POINTAPI, ByVal ncount As Long) As Long


  • Paramétres:

  • Hdc: Zone graphique ou sera dessiné le polygone
    lpoint:Tableau de point de type POINTAPI
    ncount:Nombre de points à dessiner

  • Déclarations:


  • Const NUM_STAR_POINTS = 13
    Const NUM_POINTS = 2 * NUM_STAR_POINTS
    Dim pts(1 To NUM_POINTS) As POINTAPI

  • Exemple:

  • 'Dessiner une étoile
    Private Sub Form_Resize()
    Const NUM_STAR_POINTS = 13
    Const NUM_POINTS = 2 * NUM_STAR_POINTS
    Dim pts(1 To NUM_POINTS) As POINTAPI
    Dim rx1 As Single
    Dim rx2 As Single
    Dim ry1 As Single
    Dim ry2 As Single
    Dim theta As Single
    Dim dtheta As Single
    Dim cx As Single
    Dim cy As Single
    Dim i As Integer

    Cls
    rx2 = ScaleWidth * 0.5
    ry2 = ScaleHeight * 0.5
    rx1 = rx2 * 0.5
    ry1 = ry2 * 0.5
    cx = ScaleWidth / 2
    cy = ScaleHeight / 2

    ' Calculate points.
    dtheta = 2 * 3.14159265 / NUM_POINTS
    theta = 0
    For i = 1 To NUM_POINTS Step 2
    pts(i).x = cx + rx1 * Cos(theta)
    pts(i).y = cy + ry1 * Sin(theta)
    theta = theta + dtheta
    pts(i + 1).x = cx + rx2 * Cos(theta)
    pts(i + 1).y = cy + ry2 * Sin(theta)
    theta = theta + dtheta
    Next i

    FillStyle = vbFSSolid
    FillColor = vbGreen
    ForeColor = vbBlue
    DrawWidth = 2
    Polygon hdc, pts(1), NUM_POINTS
    End Sub



Cette fonction reconnait les propriétés de dessin: FillStyle, FillColor, ForeColor, DrawWidth, etc.

Imprimer l'article





SARL GTSOFT
44 BD DAUTEL
Z.A. DU VISSOIR
49800 TRELAZE
Tél: 02 41 27 57 34 - Fax 02 41 27 57 35
Site réalisé par la société ACS Informatique
Créatrice du logiciel de textile Flextil

Logiciel Integrem, application informatique dédiée à l'aménagement foncier