111,129
社区成员
发帖
与我相关
我的任务
分享
// Constract the image object
Image image = Image.FromFile(@"F:\Picture\139南美洲地形.jpg");
// Draw a triangle on the specified location of the image
using (Graphics g = Graphics.FromImage(image))
{
using (Pen p = new Pen(Color.FromArgb(192, 168, 1)))
{
g.DrawPolygon(p, new Point[] { new Point(100, 100), new Point(97, 103), new Point(103, 103) });
}
}
// Save the result
image.Save(@"F:\Picture\139南美洲地形-Modified.jpg");
Image image = Image.FromStream(File.Open(@"F:\Picture\139南美洲地形.jpg"));
Graphics graphics = Graphics.FromImage(image);
Brush brush = new SolidBrush(Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(168)))), ((int)(((byte)(1))))));
g.FillRectangle(brush,0,0,100,100);