|
-
April 22nd, 2008, 12:12 PM
#1
Linear Gradient Brush with Alpha
I am using a Linear Gradient Brush.
I want to do something like Fade from Solid Green to Transparent Yellow (or some other similar combinations)
What this means is that you should start out green and slowly fade to yellow, but as the fade is going, the alpha also decreases.
Now if I just set up a Linear gradient brush, what I get looks more like Solid Green to Transparent Green. There is no appearance of the yellow. The gradient should start to take on a yellow tinge as it fades out but this doesn't happen.
Anyone know how I can achieve this effect?
Eggman
Using: VS 2008 w. Net 3.5
-
April 22nd, 2008, 01:11 PM
#2
Re: Linear Gradient Brush with Alpha
You'll need to have two gradient brushes overlapping each other as far as I know.
The gradient brush doesn't support more than one colour so in essence it's two brushes to do the transition, how ever I might be remembering this incorrectly so you can either double-check the Gradient brush definition on MSDN or wait for a second confirmation with possibly an easier solution.
-
April 22nd, 2008, 01:48 PM
#3
Re: Linear Gradient Brush with Alpha
Depending on your .NET version, you can set up multiple colors.
You didn't say what version you're using, however.
-
April 22nd, 2008, 02:41 PM
#4
Re: Linear Gradient Brush with Alpha
 Originally Posted by MikeVallotton
Depending on your .NET version, you can set up multiple colors.
You didn't say what version you're using, however.
FYI It does say in my signature what version I am using (.Net 2.0)
Regardless, the ability to use multiple colors isn't the problem. A fade from Green to Blue works fine. A fade from Green to Transparent Blue however does not.
It appears as though if you set the Alpha to 0, it basically ignores the RGB values during the fade.
Eggman
Using: VS 2008 w. Net 3.5
-
April 22nd, 2008, 03:16 PM
#5
Re: Linear Gradient Brush with Alpha
 Originally Posted by Eggman002
FYI It does say in my signature what version I am using (.Net 2.0)
Your signature doesn't display for me.
-
April 22nd, 2008, 04:29 PM
#6
Re: Linear Gradient Brush with Alpha
Your sig doesn't display for me, either.
You can't have multiple colors in .NET 2.0.
You could do a fade from green to yellow across half the image, then from yellow to transparent yellow across the other half.
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
|