interface
uses jpeg, Classes, Graphics, SysUtils
/// <summary>
/// </summary>
/// <param name="FilePath">图片路径</param>
/// <param name="X">文字左边距</param>
/// <param name="Y">文字上边距</param>
/// <param name="Texts">写入文字内容</param>
/// <returns>写入是否成功</returns>
function ImagePaintText(FilePath: stringX, Y: IntegerTexts: TStringList): Boolean
implementation
function JpgToBmp(FilePath: string): string
var
MyJPEG: TJPEGImage
MyBMP: TBitmap
s: string
begin
Result := ''
s := copy(FilePath, 1, Length(FilePath) - 4) + FormatDateTime('YYYYMMDDhhmmsszzz', Now) + '.bmp'
MyJPEG := TJPEGImage.Create
with MyJPEG do
begin
LoadFromFile(FilePath)
MyBMP := TBitmap.Create
with MyBMP do
begin
Width := MyJPEG.Width
Height := MyJPEG.Height
Canvas.Draw(0, 0, MyJPEG)
SaveToFile(s)
Result := s
选择combobox组件,然后指定它的items属性的内容就可以了如果想在运行的时候生成的话,可以
ComboBox1.clear
ComboBox1.AddItem('aa',self)
最简单的办法.begin with tstringlist.create do begin ls.loadfromfile('')ls.add('')endls.savetofile('')ls.free欢迎分享,转载请注明来源:内存溢出
评论列表(0条)