Click here to Skip to main content
15,905,967 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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
Posted
Comments
Albin Abel 18-Mar-11 7:43am    
Where is the code you have tried so far, color have another component apart from rgb, the alpha. If can see what are the rgb values you are trying then can give better answer
Olivier Levrey 18-Mar-11 8:35am    
What does "combination" mean? Do you want to draw a gradient or something?

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
 
Share this answer
 
Comments
Sandeep Mewara 18-Mar-11 13:48pm    
My 5 for the links!
Albin Abel 18-Mar-11 14:38pm    
Thanks Sandeep Mewara
Sergey Alexandrovich Kryukov 19-Mar-11 1:36am    
I suspect OP means something very different, not just the uniform color you suggest.
Will you look at my Answer?
--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
 
Share this answer
 
Comments
Albin Abel 19-Mar-11 12:58pm    
Yes I also suspect OP wants something different or confused. No response yet. Not sure he wants a texture or a blend. Let us wait. By the way the Universal solution is most welcome.
Sergey Alexandrovich Kryukov 19-Mar-11 14:39pm    
You're right. Thank you, Albin.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900