如何在Windows应用程序(C#.NET)中获得随机颜色值 [英] How to get Random Color Values IN Windows application (C#.NET)
本文介绍了如何在Windows应用程序(C#.NET)中获得随机颜色值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在winforms(C#.net)中获得随机颜色值.我想要颜色代码值最多为300个值..我如何获得?
How to get Random Color Values in winforms(C#.net). i Want Color code values up to 300 values.. how can i get?
推荐答案
亲爱的朋友.
这些链接将对您有所帮助:-
http://msdn.microsoft.com/en-us/library/system.drawing. knowncolor.aspx [ ^ ]
http://social.msdn.microsoft.com/Forums/zh/winforms/thread/d4fb42d3-e4f7-4a76-b650-d3b673d52912 [ http://www.dotnetspider.com/resources/27458-Get-Random-System- Color.aspx [ ^ ]
如果您有帮助,请不要忘记将其标记为答案.
谢谢
Dear Friend.
These links will be helpful to you:-
http://msdn.microsoft.com/en-us/library/system.drawing.knowncolor.aspx[^]
http://social.msdn.microsoft.com/Forums/en/winforms/thread/d4fb42d3-e4f7-4a76-b650-d3b673d52912[^]
http://www.dotnetspider.com/resources/27458-Get-Random-System-Color.aspx[^]
Please don''t forget to mark this as your answer if it helps you out.
Thanks
我假设您知道生成随机数和有关RGB颜色值.
^ ]方法可让您通过指定RGB颜色值来创建颜色.请在上面的链接中阅读该方法的第三和第四重载.通过为这些字段中的每个字段生成从1到255的随机数,您可以创建超过一百万个左右的随机颜色.
希望这会有所帮助:)
I am assuming you are aware of generating random numbers and about RGB color values.
Color.FromArgb[^] method allows you to create colors by specifying RGB color values. Please, read upon the third and the fourth overload of that method in the above link. By generating random numbers from 1 to 255 for each of these fields, you can create random colors more than a million or so.
Hope this helps :)
这篇关于如何在Windows应用程序(C#.NET)中获得随机颜色值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文