delphi实现jpg图像加文字水印

uses Jpeg;procedure TForm1.Button1Click(Sender: TObject);var Bmp : TBitmap; Jpg : TJpegImage;begin try Bmp := TBitmap.Create; Jpg := TjpegImage.Create; Jp

uses

 Jpeg;


procedure TForm1.Button1Click(Sender: TObject);

var

 Bmp : TBitmap;

 Jpg : TJpegImage;

begin

 try

   Bmp := TBitmap.Create;

   Jpg := TjpegImage.Create;

   Jpg.LoadFromFile('c:\img.jpg');

   Bmp.Assign(Jpg);

   Bmp.Canvas.Brush.Style := bsClear;

   Bmp.Canvas.Font.Color := clYellow;

   Bmp.Canvas.TextOut(10,10,'Hello World');

   Jpg.Assign(Bmp);

   Jpg.SaveToFile('c:\img2.jpg');

 finally

   bmp.Free;

   jpg.Free;

 end;

end;


相关推荐

[!--temp.pl--]