0% found this document useful (0 votes)
37 views1 page

Crtanje Poligona Ispunjenog Nekom Bojom

This document describes how to create and fill a polygon shape with color in a Windows Forms application. It defines an array of Point objects to specify the polygon vertices, creates a SolidBrush with the desired fill color, and uses the FillPolygon method along with the brush and point array to draw the filled polygon on the form's Paint event.

Uploaded by

Ibrahim Sehovic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

Crtanje Poligona Ispunjenog Nekom Bojom

This document describes how to create and fill a polygon shape with color in a Windows Forms application. It defines an array of Point objects to specify the polygon vertices, creates a SolidBrush with the desired fill color, and uses the FillPolygon method along with the brush and point array to draw the filled polygon on the form's Paint event.

Uploaded by

Ibrahim Sehovic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Crtanje poligona ispunjenog nekom bojom

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics obj = CreateGraphics();
/*
Point[] points = new Point[3];

points[0] = new Point(75, 35);
points[1] = new Point(155, 35);
points[2] = new Point(45, 95);
*/
Point[] tackePoligona = {
new Point(30, 60),
new Point(140, 80),
new Point(160, 100),
new Point(90, 120),
new Point(70, 90)
};

SolidBrush brush = new SolidBrush(Color.DodgerBlue);
obj.FillPolygon(brush, tackePoligona);
obj.Dispose();
}
}
}

You might also like