挑战:txt文件转成图像文件?SOS 不知道你说的是不是Image1.Picture.LoadFromFile('File');不是我就不知道了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先把你的文本文件读到一个书符串,再用image.canvas.outtext(x,y,s);image.picture.bitmap.savetofile(*.bmp); 在你的窗体中添加一个Timage和一个Button,Button用于调用过程,此过程把文本和gif文件的名字作为参数。 procedure TxtToGif(txt, FileName: String); var temp: TBitmap; GIF : TGIFImage; begin temp:=TBitmap.Create; try temp.Height :=400; temp.Width :=60; temp.Transparent:=True; temp.Canvas.Brush.Color:=colFondo.ColorValue; temp.Canvas.Font.Name:=Fuente.FontName; temp.Canvas.Font.Color:=colFuente.ColorValue; temp.Canvas.TextOut (10,10,txt); Imagen.Picture.Assign(nil); GIF := TGIFImage.Create; try // 转换位图为GIF GIF.Assign(Temp); // 保存GIF GIF.SaveToFile(FileName); // 显示GIF Imagen.Picture.Assign (GIF); finally GIF.Free; end; Finally temp.Destroy; End; end; 如果你不想在你的窗体中显示图片,除去Timage和有关的代码。 怎样编写一个死循环 程序设计中有一个问题一直受到困扰,希望可以得到帮助,急求 SQLSERVER2000存储过程中的IMAGE类型参数如何赋空值? MSFlexGrid在Delphi中发布问题 如何用DELPHI做一个网页浏览器? 动态生成image的问题,急,请大家帮忙! 实验室排课问题 为什么我自己的机器不能访问http://www.csdn.net 如何設這樣的數據類型? 请问,如何在Delphi的DataBase Desktop中编辑Graphic字段? 打印 救命阿!各位大虾
再用
image.canvas.outtext(x,y,s);
image.picture.bitmap.savetofile(*.bmp);
var
temp: TBitmap;
GIF : TGIFImage;
begin
temp:=TBitmap.Create;
try
temp.Height :=400;
temp.Width :=60;
temp.Transparent:=True;
temp.Canvas.Brush.Color:=colFondo.ColorValue;
temp.Canvas.Font.Name:=Fuente.FontName;
temp.Canvas.Font.Color:=colFuente.ColorValue;
temp.Canvas.TextOut (10,10,txt);
Imagen.Picture.Assign(nil); GIF := TGIFImage.Create;
try
// 转换位图为GIF
GIF.Assign(Temp);
// 保存GIF
GIF.SaveToFile(FileName);
// 显示GIF
Imagen.Picture.Assign (GIF);
finally
GIF.Free;
end;
Finally
temp.Destroy;
End;
end; 如果你不想在你的窗体中显示图片,除去Timage和有关的代码。