Text effects GDI+
I was reading this article of codeproject.
and I would like to achieve the same fog text effect using gdi or gdi+. I am not concered about the scrolling and other features of this article, just the ability of apply a fog effect to the end of a text string
// Draws fog effect with help of gradient brush with alpha colors.
using (Brush br = new LinearGradientBrush(new Point(0, 0), new Point(0, this.Height),
Color.FromArg开发者_JAVA百科b(255, this.BackColor), Color.FromArgb(0, this.BackColor)))
{
e.Graphics.FillRectangle(br, this.ClientRectangle);
}
What are you after exactly - the example you gave already is gdi+.
If you want to apply a fog effect (gradient) to a line of text. First measure the bounding rect of the text, then create the brush to fit this rect and apply it above the text, or just use the brush to draw the text. If this is what you're after say so and I'll dig up some code.
精彩评论