如何设置两种颜色的组合作为winform的背景色 [英] How to Set Combination of Two colour as background color of winform

查看:245
本文介绍了如何设置两种颜色的组合作为winform的背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在尝试将两种颜色的组合设置为winform的背景色...这是可能的....我尝试了一些rgb组合,但是我没有得到

Hello,
I am trying to set combination of two colors as background color of a winform...is this possible....I have tried some rgb combinations but i am not getting

推荐答案

这是结合RGB http://www.colortools.net/color_combination.html [ ^ ]

这是有关alpha的链接说明

http://en.wikipedia.org/wiki/Alpha_compositing [
Here is a cool tool to combine RGB http://www.colortools.net/color_combination.html[^]

Here is the link explain about alpha

http://en.wikipedia.org/wiki/Alpha_compositing[^]

your choice


最普遍的答案是:为背景构造一些特殊的画笔.您可以选择以下选项:System.Drawing.Drawing2D.HatchBrushSystem.Drawing.Drawing2D.LinearGradientBrushSystem.Drawing.TextureBrush(我省略了不太合适的类或可靠的类).

更通用的只是使用从方法System.Windows.Forms.OnPaint的事件参数参数获得的System.Drawing.Graphic实例进行的任意图片渲染.

—SA
Most universal answer is: construct some special brush for the background. Here are your choices: System.Drawing.Drawing2D.HatchBrush, System.Drawing.Drawing2D.LinearGradientBrush, System.Drawing.TextureBrush (I omitted not very suitable classes or the solid one).

More universal would be only some arbitrary picture rendering using the instance of System.Drawing.Graphic you get from the event arguments parameter of the method System.Windows.Forms.OnPaint.

—SA


这篇关于如何设置两种颜色的组合作为winform的背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆