MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
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;