C# 图形设计
2016-06-11 20:11
309 查看
阿桑地方
GDI+: 图形设备接口,是。net中实现图形、图像、以及文字处理的win32API,所有GDI+的功能都包含在C#系统的 System/ system/Drawing / image / drawing2d 中,首先创建 Graphics对象,相当于一块画布。
Graphics g = this.CreateGraphics(); //利用窗体或者空间的 方法建立
Graphics对象的引用
画笔对象: Pen 类 Pen p1 = new Pen(Color.Red , 2);
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = this.CreateGraphics();
g.Clear(this.BackColor);
Pen p1 = new Pen(Color.Red , 2);
// g.DrawLine(p1,40,50, 220, 150);
// g.DrawRectangle(p1,10,10,20 ,20);
// g.DrawEllipse(p1,80,90,100,200);
// g.DrawArc(p1 , 0 , 0 ,200, 300,-60,180);//hua yuan hu
Point[] point1 = new Point[]
{
new Point(10 ,120 ),
new Point(120 ,100 ),
new Point(300 ,180 ),
new Point(60 ,200 ),
};
g.DrawClosedCurve(p1,point1);//画一条闭合曲线
正叶线数学表达式:
r = a sin( n w ) ;
x = r cos w ;
y = r sin w ; a>0 ; n = 2 3 4 5 ......................
图像处理基础:图像的打开、保存、移动、尺寸变化、分辨率操作。动画。
图像文件类型: 位图 bmp / Icon .ico / gif .gif / 图元文件 .wmf / JPEG .jpg /
C#对图像的处理使用了了 Image 类,但其是抽象类,因此使用继承类 bitmap 类,出理由像素数据定义的位图。
Bitmap mybitap = new Bitmap("C:\ tESTimage.bmp");
Color c = new Color ();
c = mybitmap. GetPixel( 10 , 10 ) 获取指定位置的像素值
int r ,g ,b ;
r = c.R ;
g = c.G ;
b = c. B ; 将颜色值分解出单色分量值
五子棋:
五子棋:
Graphics g = this.CreateGraphics();
GDI+: 图形设备接口,是。net中实现图形、图像、以及文字处理的win32API,所有GDI+的功能都包含在C#系统的 System/ system/Drawing / image / drawing2d 中,首先创建 Graphics对象,相当于一块画布。
Graphics g = this.CreateGraphics(); //利用窗体或者空间的 方法建立
Graphics对象的引用
画笔对象: Pen 类 Pen p1 = new Pen(Color.Red , 2);
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = this.CreateGraphics();
g.Clear(this.BackColor);
Pen p1 = new Pen(Color.Red , 2);
// g.DrawLine(p1,40,50, 220, 150);
// g.DrawRectangle(p1,10,10,20 ,20);
// g.DrawEllipse(p1,80,90,100,200);
// g.DrawArc(p1 , 0 , 0 ,200, 300,-60,180);//hua yuan hu
Point[] point1 = new Point[]
{
new Point(10 ,120 ),
new Point(120 ,100 ),
new Point(300 ,180 ),
new Point(60 ,200 ),
};
g.DrawClosedCurve(p1,point1);//画一条闭合曲线
正叶线数学表达式:
r = a sin( n w ) ;
x = r cos w ;
y = r sin w ; a>0 ; n = 2 3 4 5 ......................
图像处理基础:图像的打开、保存、移动、尺寸变化、分辨率操作。动画。
图像文件类型: 位图 bmp / Icon .ico / gif .gif / 图元文件 .wmf / JPEG .jpg /
C#对图像的处理使用了了 Image 类,但其是抽象类,因此使用继承类 bitmap 类,出理由像素数据定义的位图。
Bitmap mybitap = new Bitmap("C:\ tESTimage.bmp");
Color c = new Color ();
c = mybitmap. GetPixel( 10 , 10 ) 获取指定位置的像素值
int r ,g ,b ;
r = c.R ;
g = c.G ;
b = c. B ; 将颜色值分解出单色分量值
五子棋:
五子棋:
Graphics g = this.CreateGraphics();
相关文章推荐
- C#高效绘图(转)
- 图解C#_事件
- 使用.net(C#)发送邮件(带成功案例)
- 使用C#改变鼠标的指针形状
- C# 实现IAccessible学习(四)读取QQ聊天窗口记录
- 享元模式
- C#中符号的作用备忘
- C#单纯的字母数字ASCII码转换
- c# 基类、派生类应用
- C#操作word:将rtf中的ole对象通过MathType转换成MathML
- 访问者模式
- C#中DataGridView控件绑定控件绑定数据源方式
- 中介者模式
- C#创建使用一般处理程序.ashx
- C#中委托(Delegates)的使用方法详解
- 命令模式
- C#基础-->抽象类(abstract)和接口(Interface)
- C#基础-->方法的重载(overload)与重写(override)
- C#将状态栏标签靠右排列
- C#操作 word代码