Delphi GDI + DrawString从左到右透明

时间:2015-01-24 11:17:30

标签: delphi gdi+

我有问题从左侧和右侧绘制文本透明,如下例所示: image1的:

enter image description here

到目前为止我做了什么:

var
  linGrBrush: TGPLinearGradientBrush;
  Text : String;
  x, y : Single;
Begin
  Graphics.Clear(0);
  linGrBrush := TGPLinearGradientBrush.Create(MakePoint(0, 0),
                  MakePoint(300, 0), MakeColor(0, 0, 0, 0), MakeColor(255, 255, 0, 0));
      linGrBrush.SetBlendTriangularShape(0.8);
      Text := 'Transparent Text From Left And Right';
      x:= 0;
      y:= 0;
      Graphics.DrawString(Text, Length(Text), Font, MakePoint(x, Y), linGrBrush);

结果: 图像2:

enter image description here

我该如何解决这个问题?

0 个答案:

没有答案