1. 程式人生 > >Delphi SQL資料庫存取圖片(利用流)

Delphi SQL資料庫存取圖片(利用流)

 if not FieldByName('BUGPic').IsNull then
      begin
        try
          PicStream := TMemoryStream.Create;
          TBlobField(FieldByName('BUGPic')).SaveToStream(PicStream);
          PicStream.Position := 0;
          imgBugPic.Picture.Bitmap.LoadFromStream(PicStream);
          PicStream.Free;
        except
          ShowMessage('對不起,圖片有問題.');
        end;
      end;