GDI实例3,绘制圆形、矩形等图形
// 处理窗体显示事件。
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
SolidBrush redBrush = new SolidBrush(Color.Red);
g.FillEllipse(redBrush, 0, 0, 100, 60);
g.FillPie(redBrush, 100, 0, 100, 70, 30, 300);
g.FillRectangle(redBrush, 200, 10, 100, 50);
Point[] points =
{
new Point(0, 100),
new Point(20, 120),
new Point(50, 100),
new Point(60, 200),
new Point(30, 220),
new Point(180, 200),
new Point(20, 110),
new Point(0, 220)
};
g.FillPolygon(redBrush, points);
Rectangle fillRect = new Rectangle(200, 100, 200, 200);
Region fillRegion = new Region(fillRect);
g.FillRegion(redBrush, fillRegion);
}
资源文件列表
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/App.ico , 1078
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/AssemblyInfo.cs , 1846
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/bin/Debug/GDIDrawing3.exe , 7168
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/bin/Debug/GDIDrawing3.pdb , 13824
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/Form1.cs , 2452
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/Form1.resx , 5315
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/GDIDrawing3.csproj , 4375
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/GDIDrawing3.csproj.user , 1772
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/GDIDrawing3.sln , 918
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/GDIDrawing3.suo , 6656
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/obj/Debug/GDIDrawing3.exe , 7168
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/obj/Debug/GDIDrawing3.exe.incr , 1618
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/obj/Debug/GDIDrawing3.Form1.resources , 324
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/obj/Debug/GDIDrawing3.pdb , 13824
GDI╗µ╓╞╘▓╨╬íó╛╪╨╬íó╚²╜╟╨╬/obj/Debug/GDIDrawing3.projdata , 3464
