开发者

Clear Graphics Object to Black or other RGB

开发者 https://www.devze.com 2022-12-27 04:42 出处:网络
I am a rank beginner in C#.I am currently using this code: objGraphics.Clear(SystemColors.Control); What I want to do is Clear this object to black (or some other RGB color), and I\'m stumped as to

I am a rank beginner in C#. I am currently using this code:

        objGraphics.Clear(SystemColors.Control);

What I want to do is Clear this object to black (or some other RGB color), and I'm stumped as to how to replace the SystemColors.Control with, preferably, an RGB color spec. I'd probably want to clear to bla开发者_如何学Gock most of the time. Any help will be much appreciated!


objGraphics.Clear(Color.Black);

or

objGraphics.Clear(Color.FromArgb(r, g, b));


Color black = Color.FromName("Black");
objGraphics.Clear(black);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号