我想将Color画到图片上,不知道怎样写
Color pColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(168)))), ((int)(((byte)(1)))));
//Image image = Image.FromStream( // .FromFile(@"F:\Picture\139南美洲地形.jpg");
//colorRamp1.Items.Add(image);
Color pColor = Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(168)))), ((int)(((byte)(1)))));
//Image image = Image.FromStream( // .FromFile(@"F:\Picture\139南美洲地形.jpg");
//colorRamp1.Items.Add(image);
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);
// 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");
但是你用的Color颜色(192,168,1)太暗了。。看起来不明显,建议你用个显眼一点的颜色比如红色或黄色