Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
procedure LoadImageFromDB(ABlobField: TField; AImage: TImage); var NewGraphic: TGraphicClass; GraphicClass: TGraphicExGraphicClass; Stream : TStream; begin Stream := ABlobField.DataSet.CreateBlobStream(ABlobField, bmRead); // for some reason, Size is ALWAYS 0 however, it STILL // goes into the block ???..??? if (Stream.Size > 0) then begin Stream.Position := 0; GraphicClass := FileFormatList.GraphicFromContent(Stream); if GraphicClass = nil then raise EInvalidGraphic.Create('UnknownExtension'); NewGraphic := GraphicClass.Create; try AImage.Picture.Graphic := NewGraphic; finally NewGraphic.Free; end; AImage.Picture.Graphic.LoadFromStream(Stream); if AImage.Picture.Graphic <> nil then AImage.Picture.Graphic := nil; AImage.Picture.Graphic := NewGraphic; end; end;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.