procedure SavePictureToSQL();
var
msmem: TmemoryStream;
jpg: TJpegImage;
FName: string;
SqlStr: string;
begin
//保存
try
msmem := TmemoryStream.Create;
Jpg := TjpegImage.Create;
//jpg.Assign(form2.Image1.Picture.Graphic);
jpg.Assign(MyChart1.Chart);
jpg.SaveToStream(msmem); // 1
msmem.Position := 0;
SqlStr := 'Select * From Result_PIC where ProjectName=' + QuotedStr(PrjInFo);
UnitFunction.ADOQRun(ADOQuery1, SqlStr);
if ADOQuery1.Eof = False then
begin
ADOQuery1.Edit;
TBlobField(ADOQuery1.FieldByName(FName)).LoadFromStream(msmem);
ADOQuery1.Post;
end
else
begin
ADOQuery1.Insert;
ADOQuery1.FieldByName('ProjectName').Value := PrjInFo;
TBlobField(ADOQuery1.FieldByName(FName)).LoadFromStream(msmem);
ADOQuery1.Post;
end;
Msmem.Free;
jpg.Free;
except end;
end;