2011-04-09 59 views
0

我在讀this article of codeproject文字效果GDI +

我想用gdi或gdi +實現相同的霧化文字效果。我不是concered關於滾動和這篇文章的其他功能,只需在應用霧效果的文本字符串

// 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); 
    } 

回答

2

你有什麼確切之後結束的能力 - 你已經給的例子是GDI +。

如果您想將霧化效果(漸變)應用於一行文本。首先測量文本的邊界矩形,然後創建刷子以適應該矩形並將其應用於文本上方,或者僅使用畫筆繪製文本。如果這就是你說的那樣,我會挖出一些代碼。