BGRABitmap图像操作12:文本输出带阴影

来源:互联网 发布:centos 7 ant 编辑:程序博客网 时间:2024/05/17 21:39





unit Unit1;{$mode objfpc}{$H+}interfaceuses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,  BGRABitmap, BGRAWinBitmap, BGRABitmapTypes, BGRAGradientScanner, BGRATextFX,  BGRAText;type  { TForm1 }  TForm1 = class(TForm)    procedure FormPaint(Sender: TObject);  private    { private declarations }  public    { public declarations }  end;var  Form1: TForm1;implementation{$R *.lfm}{ TForm1 }procedure TForm1.FormPaint(Sender: TObject);var  image: TBGRABitmap;  txt: TBGRACustomBitmap;  c: TBGRAPixel;begin  image := TBGRABitmap.Create(ClientWidth, ClientHeight, ColorToBGRA(ColorToRGB(clBtnFace)) );  c := ColorToBGRA(ColorToRGB(clBtnText));  txt := TextShadow(ClientWidth, ClientHeight, '您好,中国!', 30, c, BGRABlack, 5, 5, 5);  image.PutImage(0,0,txt,dmDrawWithTransparency);  txt.Free;  image.Draw(Canvas,0,0,True);  image.free;end;end.



0 0