ImgPhoto.Picture.Bitmap.FreeImage;
//ImgStream := TMemoryStream.Create;
ImgJPG := TJPEGImage.Create;
try
try
//LJP 不预读照片
with DM.qrExec do
begin
Close;
SQL.Clear;
SQL.Add('select Photo from PM_Staffer_T where PK_Staffer_ID=' + QuotedStr(DataSet.FieldByName(L_FIELD_YGBH).AsString)+' AND PK_Mine_ID='+QuotedStr(SystemParam.__MineID));
Open;
end;
if DM.qrExec.RecordCount > 0 then
begin
//解决报“JPEG error #53”错误。
ImgStream := TMemoryStream(DataSet.CreateBlobStream(DM.qrExec.FieldByName('Photo'), bmRead));
try
if ImgStream.Size > 0 then
begin
ImgJPG.LoadFromStream(ImgStream);
ImgPhoto.Picture.Bitmap.Assign(ImgJPG);
end
else
ImgPhoto.Picture.Assign(nil);
finally
ImgStream.Free;
end;
end;
DM.qrExec.Close;
except
end;
finally
ImgJPG.Free;
end;