|
-
Dec 23rd, 2007, 12:45 AM
#1
Thread Starter
Frenzied Member
[2.0] Creating a pen or brush from a set of RGB colors?
Is it possible to create a brush or pen with RGB colors like (20, 50, 150) instead of just Brushes.Red, Brushes.Green, I don't see any Brushes or Pens.FromArgb()
Thanks
-
Dec 23rd, 2007, 01:23 AM
#2
Re: [2.0] Creating a pen or brush from a set of RGB colors?
The answer to your question is "no". That said, it is eminently possible to create a Pen or Brush from a Color value, and there is a Color.FromArgb method.
-
Dec 23rd, 2007, 01:59 AM
#3
Thread Starter
Frenzied Member
Re: [2.0] Creating a pen or brush from a set of RGB colors?
Can you give an example? I have tried many times in VB & C# to create a brush from a color...
Thanks
-
Dec 23rd, 2007, 04:16 AM
#4
Re: [2.0] Creating a pen or brush from a set of RGB colors?
When you read the documentation for the Brush class you must have missed this bit:
 Originally Posted by MSDN
This is an abstract base class and cannot be instantiated. To create a brush object, use classes derived from Brush, such as SolidBrush, TextureBrush, and LinearGradientBrush.
As you may or may not have noticed, the properties of the Brushes class that are named after colours all return SolidBrush objects.
Is anyone starting to think that reading the documentation is a good idea or am I just wasting my time?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|