62,046
社区成员
发帖
与我相关
我的任务
分享
System.Drawing.Image bmp = Bitmap.FromFile(imagepath);
Graphics g = Graphics.FromImage(bmp);
Rectangle rct = new Rectangle((int)max(ds.face[0].center.x * 480 / 100.0 - ds.face[0].width * 480/ 200.0, 0),
(int)max(ds.face[0].center.y * 640 / 100.0 - ds.face[0].height * 640 / 200.0, 0),
(int)(ds.face[0].width * 480 / 100.0), (int)(ds.face[0].height * 640 / 100.0));
g.DrawRectangle(new Pen(Color.Red, 5), rct);
g.Save();
bmp.Save(imagepath2 + "a" + name);