BGRABitmap图像操作12:四行不同效果文本输出

来源:互联网 发布:php导航源码 编辑:程序博客网 时间:2024/06/07 04:00




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  bmp1,bmp2: TBGRACustomBitmap;  txt: String;begin  txt:= 'TextShadow!';  // Simple Shadow  bmp1:= TextShadow(200,40,txt,32,BGRAWhite,BGRABlack,1,1);  bmp1.Draw(Canvas,0,0,False);  bmp1.Free;  // Blured Shadow  bmp1:= TextShadow(200,40,txt,32,BGRABlack,BGRA(128,128,255,255),4,4,5);  bmp1.Draw(Canvas,0,40,False);  bmp1.Free;  // Neon Shadow ''(better with Black background)''  bmp1:= TextShadow(200,40,txt,32,BGRA(255,255,255,200),BGRA(0,255,0,255),0,0,5);  bmp1.Draw(Canvas,0,80,False);  bmp1.Free;  // Multi Shadow  bmp1:= TextShadow(250,50,txt,32,BGRAWhite,BGRA(255,0,0,255),-5,-5,4,[fsBold,fsUnderline],'Tahoma',False);  bmp2:= TextShadow(250,50,txt,32,BGRAWhite,BGRA(0,0,255,255),5,5,4,[fsBold,fsUnderline],'Tahoma',True);  bmp1.PutImage(0,0,bmp2,dmDrawWithTransparency);  bmp1.Draw(Canvas,0,120,False);  bmp1.Free;  bmp2.Free;end;end.


0 0