Mar*_*rco 61
你的意思是:
using (Graphics g = Graphics.FromImage(pb.Image))
{
using(Brush brush = new SolidBrush(your_color))
{
g.FillRectangle(brush , x, y, width, height);
}
}
Run Code Online (Sandbox Code Playgroud)
或者你可以使用
Brush brush = new SolidBrush(Color.FromArgb(alpha, red, green, blue))
Run Code Online (Sandbox Code Playgroud)
其中阿尔法从0到255,所以128的阿尔法值会给你50%opactity.