delphi 从库里取出IMAGE图片数据做分页显示,内存报错,请教大侠如何处理?

问题如题,以下为代码:
procedure TFrmCaipuManage.Page_Count;
var
i:integer;
ListItem:TListItem;
Stream:TMemoryStream;
Jpg:TjpegImage;
begin
ListView1.Clear;
with adolist do
begin
sql.Clear;
sql.Add('select * from Tb_Caipu ');
open;
RecSum:=RecordCount;
if Page = 0 then Page := 1;
if Page > RecordSet.RecordCount then page := RecordSet.RecordCount;
Recordset.PageSize := 12;
RecordSet.AbsolutePage := Page;
for i:= 1 to Recordset.PageSize do
begin
ListItem := ListView1.Items.Add;
ListItem.SubItems.Add(RecordSet.Fields.Item[0].value);
ListItem.SubItems.Add(RecordSet.Fields.Item[1].Value);
TBlobField(RecordSet.Fields.Item[3]).SaveToStream(Stream);//<<<-------此行报错!!!!!
Stream.Position :=0;
jpg.LoadFromStream(Stream); // 加载图片
imgPhoto.Picture.Assign(Jpg);
Next;
if RecordSet.EOF then exit;
end;
end;
end;

2个回答

图片说明
用完记得FREE

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问