如何 Graphics 对象设置背景色

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

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

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

posted @ 2015-10-29 14:09  刘小吉  阅读(4166)  评论(0编辑  收藏  举报