怎样在图片加入日期?(200分)

  • 主题发起人 主题发起人 细文
  • 开始时间 开始时间

细文

Unregistered / Unconfirmed
GUEST, unregistred user!
最近买了一台摄影机。发觉拍摄的图片没有日期。试过很多软件在图片加入文字。
但只有一幅一幅加入日期太烦。请问有没有批量加入文字的方法?
 
var a:tbitmap; s:string;
begin
a:= tbitmap.Create;
a.Canvas.Brush.Style:=bsclear;
a.LoadFromFile('a.bmp');
s:=datetimetostr(now);
a.Canvas.TextOut(0,0,s);
a.SaveToFile('a.bmp');
a.Free;
 
var
myFileListbox:TFileListbox;
i:integer;
myBMP:TBitMap;
begin
myFileListbox:=TFileListbox.create(Self);
myFileListbox.parent:=form1;
myFileListbox.Directory:=ExtractFilePath(Application.ExeName);
myFileListbox.mask:='*.bmp';
for i:=0 to myFileListbox.Count-1 do
begin
myBMP:=TBitMap.Create;
myBMP.Canvas.Brush.Style:=bsclear;
myBMP.LoadFromFile(myFileListbox.Items);
myBMP.Canvas.TextOut(0,0,DateTimeToStr(now));
myBMP.SaveToFile(myFileListbox.Items);
myBMP.Free;
end;
myFileListbox.Free;
end;
 
能否对其他格式操作。如JPEG
 
image2.Canvas.Draw(0,0,image1.picture.graphic);
image2.AutoSize :=True;    {IMAGE2没有扩大至整张图片一样大????????}[?]
image2.Canvas.Pen.Color :=clred;
image2.Canvas.brush.style:=bsclear;
image2.Canvas.TextOut(20,20,'日期');
image2.Picture.SaveToFile('E:/AA.jpg');
 
可以对其他格式操作,如果是JPEG
要加入
uses jpeg;
 
多人接受答案了。
 
后退
顶部