我在读this article of codeproject。
我也想用gdi或gdi+来实现同样的雾化文本效果。我不关心这篇文章的滚动和其他功能,只关心将雾效果应用到文本字符串末尾的能力
// 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.FromArgb(255, this.BackColor), Color.FromArgb(0, this.BackColor)))
{
e.Graphics.FillRectangle(br, this.ClientRectangle);
}发布于 2011-04-28 19:30:32
你到底想要什么--你已经给出的例子是gdi+。
如果要对文本行应用雾效果(渐变)。首先测量文本的边框,然后创建适合此矩形的画笔并将其应用于文本上方,或仅使用画笔绘制文本。如果这就是你想要的,那就说出来,我会找出一些代码。
https://stackoverflow.com/questions/5605562
复制相似问题