may be use
save:
Jpeg1:=TJpegImage.Create;
Z1:=TStringStream.Create('');
Jpeg1.Assign(Image1.Picture.Graphic);
Jpeg1.CompressionQuality:=ImgCmpsQuality;
Jpeg1.SaveToStream(Z1);
FieldByName('PhotoImg').Value:=Z1.DataString;
FieldByName('PhotoSize').AsInteger:=Z1.Size;
Post;
DM1.WriteOperateLog(OperateCode,TableName,RecordID);
Z1.Free;
load:
PhotoStream:=TStringStream.Create(DBGrid_Guest.DataSource.DataSet.FieldByName('PhotoImg').Value);
Jpeg1:=TJpegImage.Create;
Jpeg1.LoadFromStream(PhotoStream);
Jpeg1.SaveToFile(TempDir+'AAA.JPG');
Image1.Picture.LoadFromFile(TempDir+'AAA.JPG');
DeleteFile(TempDir+'AAA.JPG');
PhotoStream.Free;
Jpeg1.Free;