图片处理软件简单c#

时间:2019-01-01 16:53:09
【文件属性】:

文件名称:图片处理软件简单c#

文件大小:13KB

文件格式:EXE

更新时间:2019-01-01 16:53:09

图片

图片处理软件简单c#public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Pen p = new Pen(Color.Black, 3); Graphics g = this.CreateGraphics(); g.DrawEllipse(p, 100, 100, 300, 300); } private void button2_Click(object sender, EventArgs e) { SolidBrush b = new SolidBrush(Color.Red); Graphics g = this.CreateGraphics(); g.FillEllipse(b,20,20,150,150); } private void button3_Click(object sender, EventArgs e) { TextureBrush b = new TextureBrush(new Bitmap(@"E:\壁纸\叶子.jpg")); Graphics g = this.CreateGraphics(); g.FillEllipse(b, 50, 50, 150, 150); } private void button4_Click(object sender, EventArgs e) { TextureBrush b = new TextureBrush(new Bitmap(@"E:\壁纸\叶子.jpg")); Pen p = new Pen(b, 5); Graphics g = this.CreateGraphics(); g.DrawRectangle(p,150,150,50,50); } bool zt = false; bool bi= false; Pen p1; Point z1, z2; private void button5_Click(object sender, EventArgs e) { p1 = new Pen(Color.Black, 5); if (bi) { bi = false; } else { bi = true; } } private void Form2_MouseDown(object sender, MouseEventArgs e) { if (bi) { zt = true; z2 = this.PointToClient(Control.MousePosition); z1 = this.PointToClient(Control.MousePosition); } } private void Form2_MouseUp(object sender, MouseEventArgs e) { if (bi) { zt = false; } } private void Form2_MouseMove(object sender, MouseEventArgs e) { if (zt) { z2= this.PointToClient(Control.MousePosition); Graphics g = this.CreateGraphics(); g.DrawLine(p1,z1,z2); z1 = z2; }


网友评论