C#画笔Pen画虚线的方法
本文实例讲述了C#画笔Pen画虚线的方法。分享给大家供大家参考。具体实现方法如下:
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Drawing.Drawing2D;
namespaceWindowsApplication2
{
publicpartialclassForm11:Form
{
publicForm11()
{
InitializeComponent();
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
Penpen2=newPen(Color.Blue,12);
pen2.DashStyle=DashStyle.Custom;
pen2.DashPattern=newfloat[]{1f,1f};
Graphicsg2=this.CreateGraphics();
g2.DrawLine(pen2,10,150,500,150);
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
热门推荐
10 低调祝福语简短10字
11 祝福语简短古诗词
12 早安祝福语大全简短励志
13 教练生日祝福语 简短独特
14 校长退休文案祝福语简短
15 妹妹生日祝福语简短唯美
16 牛年女神节祝福语简短
17 入学祝福语简短走心
18 对生活祝福语简短精辟