Here is one way to do it...
procedure TForm1.CreateWatermarkLayer(AString: string; AFontName: string;
AFontSize: Integer; AFontColor: TColor; ATransparency: integer; AAddShadow: boolean);
{ Create a watermark layer. }
var
iLayer: Integer;
iListItem: TListItem;
begin
{ All layers have the same size }
ImageEnView1.LayersSync := True;
{ Add a new layer }
iLayer := ImageEnView1.LayersAdd;
{ Fill the layer with White }
ImageEnView1.Proc.Fill(TColor2TRGB(clWhite));
{ Output our text }
ImageEnView1.Proc.TextOut(Align_Text_Horz_Center, Align_Text_Vert_Center,
AString, AFontName, AFontSize, AFontColor, [fsBold]);
{ Make the white background transparent }
ImageEnView1.Proc.SetTransparentColors(TColor2TRGB(clWhite), TColor2TRGB(clWhite), 0);
{ Add a shadow }
if AAddShadow = True then
ImageEnView1.Proc.AddSoftShadow(2, 3, 3);
{ Set the layers transparency }
ImageEnView1.Layers[iLayer].Transparency := ATransparency;
end;
procedure TForm1.AddWatermark1Click(Sender: TObject);
var
iWatermark: string;
iTransparency: integer;
begin
iWatermark := Watermark1.Text;
iTransparency := StrToIntDef(Transparency1.Text, 75);
CreateWatermarkLayer(iWatermark, 'Arial', 36, clBlack, iTransparency, False);
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development