日期:2014-05-18 浏览次数:20847 次
if (pictureBox1.Image != null) { System.Drawing.Bitmap map = new Bitmap(pictureBox1.Image); Graphics g = Graphics.FromImage(map); Pen pen = new Pen(Color.Red, 10); int width = pictureBox1.Width; int height = pictureBox1.Height; Rectangle WeiXingRe = new Rectangle((int)(width * 0.28), (int)(height * 0.27), (int)(width * 0.35), (int)(height * 0.05)); g.DrawRectangle(pen, WeiXingRe); } else { MessageBox.Show("请选择图片"); }