CLOSURING
CLOSURING
关注数: 2
粉丝数: 23
发帖数: 112
关注贴吧数: 27
转让物理学大题典 转物理学大题典:固体物理、量子力学、原子亚原子和相对论分册。全新,名字都没写,三本100RMB不包邮,有意请私聊。
c#保存图片求助,为何保存之后是空白的(代码在下面)? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Drawing.Drawing2D; namespace Drum { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //实现画图功能 private Graphics g = null; private Point oldpoint = new Point(0, 0); Point ptstart, ptend; private void pictureBox3_MouseDown(object sender, MouseEventArgs e) { g = pictureBox3.CreateGraphics(); oldpoint = e.Location; ptstart = e.Location; this.pictureBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); } private void pictureBox3_MouseMove(object sender, MouseEventArgs e) { if (g != null) { //异常处理 try { g.DrawLine(Pens.Black, oldpoint, e.Location); oldpoint = e.Location; ptend = e.Location; } catch (Exception ex) { } //异常处理 } } private void pictureBox3_MouseUp(object sender, MouseEventArgs e) { g.Dispose(); this.pictureBox3.MouseMove -= new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); /*if ((ptstart.X-ptend.X)*(ptstart.X-ptend.X)+(ptstart.Y-ptend.Y)*(ptstart.Y-ptend.Y)<=100) { }*/ //保存图片 Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox3.Height); pictureBox3.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save("F:\\1.bmp"); //保存图片 }
c#保存图片求助,为何保存之后是空白的(代码在下面)? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Drawing.Drawing2D; namespace Drum { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //实现画图功能 private Graphics g = null; private Point oldpoint = new Point(0, 0); Point ptstart, ptend; private void pictureBox3_MouseDown(object sender, MouseEventArgs e) { g = pictureBox3.CreateGraphics(); oldpoint = e.Location; ptstart = e.Location; this.pictureBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); } private void pictureBox3_MouseMove(object sender, MouseEventArgs e) { if (g != null) { //异常处理 try { g.DrawLine(Pens.Black, oldpoint, e.Location); oldpoint = e.Location; ptend = e.Location; } catch (Exception ex) { } //异常处理 } } private void pictureBox3_MouseUp(object sender, MouseEventArgs e) { g.Dispose(); this.pictureBox3.MouseMove -= new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); /*if ((ptstart.X-ptend.X)*(ptstart.X-ptend.X)+(ptstart.Y-ptend.Y)*(ptstart.Y-ptend.Y)<=100) { }*/ //保存图片 Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox3.Height); pictureBox3.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save("F:\\1.bmp"); //保存图片 }
c#保存图片求助,为何保存之后是空白的(代码在下面)? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Drawing.Drawing2D; namespace Drum { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //实现画图功能 private Graphics g = null; private Point oldpoint = new Point(0, 0); Point ptstart, ptend; private void pictureBox3_MouseDown(object sender, MouseEventArgs e) { g = pictureBox3.CreateGraphics(); oldpoint = e.Location; ptstart = e.Location; this.pictureBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); } private void pictureBox3_MouseMove(object sender, MouseEventArgs e) { if (g != null) { //异常处理 try { g.DrawLine(Pens.Black, oldpoint, e.Location); oldpoint = e.Location; ptend = e.Location; } catch (Exception ex) { } //异常处理 } } private void pictureBox3_MouseUp(object sender, MouseEventArgs e) { g.Dispose(); this.pictureBox3.MouseMove -= new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); /*if ((ptstart.X-ptend.X)*(ptstart.X-ptend.X)+(ptstart.Y-ptend.Y)*(ptstart.Y-ptend.Y)<=100) { }*/ //保存图片 Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox3.Height); pictureBox3.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height)); bmp.Save("F:\\1.bmp"); //保存图片 }
visual studio 2010安装求助 求指点
求帮忙为何project无法运行
新人求助,hello怎么弄
喜欢一个女孩,但是她现在不理我 喜欢一个女孩,但是她现在不理我怎么办
1
下一页