pictureBox绘图保存问题 现在程序可以在pictureBox上随意绘图,但保存的时候picturebox.image里为什么是null?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 最后将画完的image保存进picturebox.image。这步不是自动实现的,需要写代码 具体怎么写,我现在用的鼠标事件绘的图,但保存时候pictureBox1里空的private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { this.CanMove = true; startpt.X = e.X; startpt.Y = e.Y; } private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { if (this.CanMove == true) { Graphics g = pictureBox1.CreateGraphics(); endpt.X = e.X; endpt.Y = e.Y; g.DrawLine(new Pen(Color.Red, 1), startpt, endpt); startpt = endpt; } } private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { Graphics g = this.CreateGraphics(); g.DrawLine(new Pen(Color.Red, 1), this.startpt, new Point(e.X, e.Y)); this.CanMove = false; } 图片正则问题 ( 超级急 ) c# xml 文章 问个简单的问题 自己设计的一个智力拼图游戏,欢迎指点 datagrid 通用数字中文互转换工具代码 哪位那高人帮我解决一下啊? 如何实现这样的动态url 高手指教:如何在C#中用WMI获得本机windows已经安装的组件 使用C#是否可以实现实时监听数据库日志 读取和分析出数据库变更数据? 关于cookieparameter获取cookie值的问题,在线等! 集成SmsCore.dll的C#应用程序在windows2008R2下启动异常
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
this.CanMove = true;
startpt.X = e.X;
startpt.Y = e.Y;
} private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (this.CanMove == true)
{
Graphics g = pictureBox1.CreateGraphics();
endpt.X = e.X;
endpt.Y = e.Y;
g.DrawLine(new Pen(Color.Red, 1), startpt, endpt);
startpt = endpt;
}
} private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
Graphics g = this.CreateGraphics();
g.DrawLine(new Pen(Color.Red, 1), this.startpt, new Point(e.X, e.Y));
this.CanMove = false;
}