December 2001
Beginner
976 pages
22h 4m
English
![]() | Polygons |
In addition to drawing text, lines, and rectangles, you can also draw polygons that contain any number of sides. The way you would go about doing this is to first create an array of points that represent the vertices of the polygon. This array of points then is passed to the DrawPolygon method on the Graphics object. The Graphics object takes care of drawing the lines from each point to the next and also from the last point back to the first (to create a closed shape).
Here is a simple example that shows how this is done:
Imports System.Windows.Forms Imports System.Drawing.Drawing2D Imports System.Drawing Public Class Form1 Inherits System.Windows.Forms.Form ...
Read now
Unlock full access