十、使用GDI+画图
摘要:使用的函数DrawIcon,DrawImageDrawIcon(Icon,Rectangle)DrawIcon(Icon,Int32,Int32)private void Form1_Paint(object sender, PaintEventArgs e){ //创建画板从Paint事件中的直接引用Graphics对象 Graphics graphics = e.Graphics; graphics.Clear(Color.Black); Icon icon = new Icon("test.ico",new Size(256,256)); graph...
阅读全文
posted @
2012-05-19 00:32
kiny
阅读(340)
推荐(0) 编辑
九、利用GDI+绘制文本
摘要:绘制文本在GDI+是非常广泛的应用。就像常见的验证码。在GDI+中使用DrawStringDrawString(String,Font,Brush,PointF)DrawString(String,Font,Brush,RectangleF)DrawString(String,Font,Brush,PointF,StringFormat)DrawString(String,Font,Brush,RectangleF,StringFormat)DrawString(String,Font,Brush,Single,Single)DrawString(String,Font,Brush,Singl
阅读全文
posted @
2012-05-18 23:52
kiny
阅读(2015)
推荐(0) 编辑
七、使用GDI+画扇形
摘要:用到函数DrawPieDrawPie(Pen,Rectangle,Single,Single)DrawPie(Pen,RectangleF,Single,Single)DrawPie(Pen,Int32,Int32,Int32,Int32,Int32,Int32,Int32)DrawPie(Pen,Single,Single,Single,Single,Single,Single)private void Form1_Paint(object sender, PaintEventArgs e){ //创建画板从Paint事件中的直接引用Graphics对象 Graphics...
阅读全文
posted @
2012-05-18 17:29
kiny
阅读(1362)
推荐(0) 编辑
六、使用GDI+画矩形、多边形
摘要:用到的函数DrawRectangle、DrawPolygonDrawRectangle(Pen,Rectangle)DrawRectangle(Pen,Int32,Int32,Int32,Int32)DrawRectangle(Pen,Single,Single,Single,Single)DrawPolygon(Pen,Point[])DrawPolygon(pen,PointF[])先画一个矩形private void Form1_Paint(object sender, PaintEventArgs e){ //创建画板从Paint事件中的直接引用Graphics对象 ...
阅读全文
posted @
2012-05-18 17:22
kiny
阅读(5054)
推荐(0) 编辑
五、使用GDI+画椭圆
摘要:前面利用DrawArc能绘制出椭圆来。GDI+还有专门绘制椭圆的函数DrawEllipseDrawEllipse(Pen,Rectangle)DrawEllipse(Pen,RectangleF)DrawEllipse(Pen,Int32,Int32,Int32,Int32)DrawEllipse(Pen,Single,Single,Single,Single)private void Form1_Paint(object sender, PaintEventArgs e){ //创建画板从Paint事件中的直接引用Graphics对象 Graphics graphics ...
阅读全文
posted @
2012-05-17 22:23
kiny
阅读(940)
推荐(0) 编辑
四、使用GDI+画曲线
摘要:DrawBezier(Pen,Point,Point,Point,Point)DrawBezier(Pen,PointF,PointF,PointF,PointF)DrawBezier(Pen,Single,Single,Single,Single,Single,Single,Single,Single)DrawCurve(Pen,Point[])DrawCurve(Pen,PointF[])DrawCurve(Pen,Point[],Single)DrawCurve(Pen,PointF[],Int32,Int32)DrawCurve(Pen,Point[],Int32,Int32,Sing
阅读全文
posted @
2012-05-17 18:48
kiny
阅读(2153)
推荐(0) 编辑
三、使用GDI+画弧线
摘要://使用下面的函数DrawArc(Pen,Rectangle,Single,Single)DrawArc(Pen,RectangleF,Single,Single)DrawArc(Pen,Int32,Int32,Int32,Int32,Int32,Int32)DrawArc(Pen,Single,Single,Single,Single,Single,Single)private void Form1_Paint(object sender, PaintEventArgs e){ //创建画板从Paint事件中的直接引用Graphics对象 Graphics graphic...
阅读全文
posted @
2012-05-17 18:31
kiny
阅读(3002)
推荐(0) 编辑
二、使用GDI+画线(补充)
摘要:DrawLines(Pen pen,PointF[] points)绘制多个直线private void Form1_Paint(object sender, PaintEventArgs e){ //创建画板从Paint事件中的直接引用Graphics对象 Graphics graphics = e.Graphics; //定义画笔 Pen pen = new Pen(Color.Red, 3.0f); //定义坐标数组 PointF[] points = { new PointF(10.0f,10.0f),...
阅读全文
posted @
2012-05-17 15:17
kiny
阅读(1337)
推荐(0) 编辑
一、使用GDI+画线
摘要:.Net中在System.Drawing命名空间下使用Graphics类画线。有四种方法画线。//绘制一条连接两个Point结构的线DrawLine(Pen,Point,Point)//绘制一条连接两个PointF结构的线DrawLine(Pen,PointF,PointF)//绘制一条连接由坐标对指定的两个点的线条DrawLine(Pen,Int32,Int32,Int32,Int32)//绘制一条连接由坐标对指定的两个点的线条DrawLine(Pen,Single,Single,Single,Single)private void Form1_Paint(object sender, Pa
阅读全文
posted @
2012-05-17 00:14
kiny
阅读(1810)
推荐(0) 编辑