Title / Description
Code uses ... jpeg; type ... procedure ReadImgFromDB(); procedure LoadImgToDB(); procedure TForm1.ReadImgFromDB(); var jpg:TJPEGImage; Blob:TMemoryStream; begin try jpg:=TJPEGImage.Create; Blob:=TADOBlobStream.Create(TBlobField(DM.tblAnteny.FieldByName('Oioi')),bmRead); if Blob.Size = 0 then Exit; jpg.LoadFromStream(Blob); img1.Picture.Assign(jpg); jpg.Free; Blob.Free; except on e:Exception do begin jpg.Free; Blob.Free; end; end; end; procedure TForm1.LoadImgToDB(); var Blob:TMemoryStream; begin try if dlgOpen1.Execute then begin DM.tblAnteny.Edit; Blob:=TADOBlobStream.Create(TBlobField(DM.tblAnteny.FieldByName('Oioi')),bmWrite); Blob.LoadFromFile(dlgOpen1.FileName); Blob.Free; DM.tblAnteny.Post; end; except on e:Exception do end; end;
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code