Z
zoulin
Unregistered / Unconfirmed
GUEST, unregistred user!
各位:
请教这个函数为何运行时老出错?
Image1.Picture.Graphic.Assign(readjpeg(table1,'graph'));
function readjpeg(tablename:ttable;fieldname:string):TJpegImage;
var
jpeg: TJpegImage; //Requires the "jpeg" unit added to "uses" clause.
Stream :TStringStream;
begin
//TBlobField(Table1.FieldByName('BITMAP')).BlobSize
jpeg:=tjpegimage.Create;
Stream:=TStringStream.Create(tablename.FieldByName(fieldname).value);
jpeg.loadfromstream(stream);
result:=jpeg;
jpeg.Free;
stream.Free;
end;
请教这个函数为何运行时老出错?
Image1.Picture.Graphic.Assign(readjpeg(table1,'graph'));
function readjpeg(tablename:ttable;fieldname:string):TJpegImage;
var
jpeg: TJpegImage; //Requires the "jpeg" unit added to "uses" clause.
Stream :TStringStream;
begin
//TBlobField(Table1.FieldByName('BITMAP')).BlobSize
jpeg:=tjpegimage.Create;
Stream:=TStringStream.Create(tablename.FieldByName(fieldname).value);
jpeg.loadfromstream(stream);
result:=jpeg;
jpeg.Free;
stream.Free;
end;