var
strTempFile: String;
begin
if not TBlobField(Table1.FindField('photo')).IsNull then
begin
strTempFile := ExtractFilePath(ParamStr(0)) + '~Temp' + FormatDateTime('hhmmss', Time) + '.jpg'; // 或是 bmp,看保存时的格式。
if FileExists(strTempFile) then
DeleteFile(strTempFile); TBlobField(Table1.FindField('photo')).SaveToFile(strTempFile);
Image1.Picture.LoadFromFile(strTempFile);
DeleteFile(strTempFile);
end;
end;
strTempFile: String;
begin
if not TBlobField(Table1.FindField('photo')).IsNull then
begin
strTempFile := ExtractFilePath(ParamStr(0)) + '~Temp' + FormatDateTime('hhmmss', Time) + '.jpg'; // 或是 bmp,看保存时的格式。
if FileExists(strTempFile) then
DeleteFile(strTempFile); TBlobField(Table1.FindField('photo')).SaveToFile(strTempFile);
Image1.Picture.LoadFromFile(strTempFile);
DeleteFile(strTempFile);
end;
end;
Image1.Picture.LoadFromFile(strTempFile);
DeleteFile(strTempFile);