如何 Graphics 对象设置背景色

用 Clear 方法可以轻松地给 Graphics 对象设置背景色。

using (Bitmap bmp = new Bitmap(width, height))
{
    using (Graphics graphics = Graphics.FromImage(bmp))
    {
        graphics.Clear(Color.White);

当然这是在还没有绘图之前就要设置。

原文地址:https://www.cnblogs.com/liuxiaoji/p/4920376.html