c# 参数无效 未处理ArgumentException
Imageimg;privatevoidbutton1_Click(objectsender,EventArgse){Bitmapbmp;using(bmp=newBit...
Image img; private void button1_Click(object sender, EventArgs e) { Bitmap bmp; using ( bmp = new Bitmap(pictureBox1.Image.Width, pictureBox1.Image.Height)) { Graphics g = Graphics.FromImage(bmp); g.SmoothingMode = SmoothingMode.AntiAlias; g.DrawImage(pictureBox1.Image, new Rectangle(0, 0, pictureBox1.Image.Width, pictureBox1.Image.Height)); Color col = Color.Black; Pen p = new Pen(col, 8); Point po1 = new Point(100, 100); Point po2 = new Point(200, 100); g.DrawLine(p, po1, po2); pictureBox2.Image = (Image)bmp; pictureBox1.Image = (Image)bmp; bmp.Save(@"C:\Users\DHPX\Desktop\ILSpy.jpg"); } }
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询