Comment fait-on pour créer dynamiquement un objet point ?
j'ai trouvé cet exemple dans la doc :
je voudrais initialiser le polygone à partir de données variables et je ne sais pas comment créer dynamiquement curvepoints avec un nombre de coordonnées variable.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Public Sub DrawPolygonPoint(ByVal e As PaintEventArgs) ' Create pen. Dim blackPen As New Pen(Color.Black, 3) ' Create points that define polygon. Dim point1 As New Point(50, 50) Dim point2 As New Point(100, 25) Dim point3 As New Point(200, 5) Dim point4 As New Point(250, 50) Dim point5 As New Point(300, 100) Dim curvePoints As Point() = {point1, point2, point3, point4, point5} ' Draw polygon to screen. e.Graphics.DrawPolygon(blackPen, curvePoints) End Sub
Merci d'avance.
Partager