日期:2014-05-17 浏览次数:20739 次
private Bitmap pic1;
pic1 = pictureBox4.Image;//这一句出错了
//错误9无法将类型“System.Drawing.Image”隐式转换为“System.Drawing.Bitmap”。存在一个显式转换(是否缺少强制转换?)
Graphics g1 = Graphics.FromImage(pic1);
Pen mypen = new Pen(Color.Red);
g1.DrawLine(mypen, tempx_pre, tempy_pre,tempx,tempy);
g1.Dispose();
pictureBox1.Image = pic1;
Bitmap bmp = pictureBox1.Image as Bitmap;