Difference between revisions of "C#:Flags with Polygons Tutorial"

From Progzoo
Jump to: navigation, search
(Bahamas)
(Bahamas)
Line 35: Line 35:
 
}
 
}
 
]]></prog>
 
]]></prog>
 +
<answer>
 +
static void drawFlag(Graphics g)
 +
{
 +
  Brush pb = new SolidBrush(Color.FromArgb(127,192,255));
 +
  g.FillRectangle(pb,0,0,300,150);
 +
  Brush yl = new SolidBrush(Color.FromArgb(255,255,0));
 +
  g.FillRectangle(yl,0,50,300,50);
 +
  Point [] tri={new Point(0,0),
 +
                new Point(112,75),
 +
                new Point(0,150)};
 +
  g.FillPolygon(Brushes.Black,tri);
 +
}
 +
</answer>
 
<p>To complete the flag of the Bahamas you must add the black
 
<p>To complete the flag of the Bahamas you must add the black
 
triangle which represents the unity and vigour of the people.</p>
 
triangle which represents the unity and vigour of the people.</p>

Revision as of 14:24, 6 March 2013

Drawing flags: filling polygons.

Napier

The Napier flag is a red triangle on a white square. It suggests the letter N.
Flagnapier.png

[Font] [Default] [Show] [Resize] [History] [Profile]

Bahamas

To complete the flag of the Bahamas you must add the black triangle which represents the unity and vigour of the people.

Flagbahamas.png

[Font] [Default] [Show] [Resize] [History] [Profile]

Jamaica

We need to four triangle to draw the flag of Jamaica. If we get it right we will leave a yellow cross.

Flagjamaica.png

[Font] [Default] [Show] [Resize] [History] [Profile]

Seychelles

The Seychelles has a cheerful flag; four triangles and a quadrilateral.

Flagseychelles.png

[Font] [Default] [Show] [Resize] [History] [Profile]