Hello,
I was wondering if it was possible to draw text with a gradient fill using
TextRenderer.DrawText. I’m currently using Graphics.DrawString and a
brush to get the effect I want. I am getting a large performance increase
using TextRenderer.DrawText, but I can’t figure out how to retain the ability
to display text with a color gradient.
With DrawString:
gBrush = new LinearGradientBrush(rect,Color.LawnGreen, Color.DarkGreen,angle,true);
dc.DrawString(aString,
boldFont, gBrush, 25,25);
With DrawText:
TextRenderer.DrawText(e.Graphics, aString, boldFont, aRect, Color.DarkGreen);
I imagine this has to be pretty simple because I have yet to
find someone to ask this question before me yet, so everone else must be
figuring it out, or I am going about this in a tottaly wrong direction.
Thanks!
James McCartneyPosted Jun 20, 2008, 2:14 PM
Thank You!
That does make a lot of sense. I will just have to figure out another way to do this entirely.
Thanks again for your help!
Mike GoldPosted Jun 20, 2008, 2:08 PM