1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
|
private void Main_Paint(object sender, PaintEventArgs e)
{
// es wird nur gezeichnet wenn sich das Programm an der obersten Position befindet
if (this.AutoScrollPosition.Y == 0)
{
// Rendering Modus wird auf AntiAlias gesetzt
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
// der Grafikpfad zum Zeichnen des Infobereichs wird erstellt
GraphicsPath menueDrawer = new GraphicsPath();
menueDrawer.StartFigure();
menueDrawer.AddBezier(new Point(0, 0), new Point(20, 5), new Point(20, 60), new Point(45, 60));
menueDrawer.AddLine(new Point(45, 60), new Point(220, 60));
menueDrawer.AddBezier(new Point(220, 60), new Point(240, 55), new Point(240, 0), new Point(265, 0));
menueDrawer.CloseFigure();
// Zweifarbig? Ja/Nein
if (bUseTwoColors)
{
e.Graphics.FillPath(new LinearGradientBrush(new Rectangle(0, 0, 265, 60), Color.White, Color.Black, LinearGradientMode.ForwardDiagonal), menueDrawer);
e.Graphics.DrawPath(new Pen(new LinearGradientBrush(new Point(0, 0), new Point(265, 0), Color.White, Color.Black)), menueDrawer);
}
else
{
e.Graphics.FillPath(new SolidBrush(Color.Gray), menueDrawer);
e.Graphics.DrawPath(new Pen(new SolidBrush(Color.DarkGray)), menueDrawer);
}
menueDrawer.Dispose();
}
} |