C
circleqq
Unregistered / Unconfirmed
GUEST, unregistred user!
我从ACCESS数据库中调出图片显示.第一次可以生成图片. 第二次就会把错...
EJPEG with message 'JPEG error #51'
我的代码如下:
if cxGDBTVFA1.controller.FocusedRecord.Values[5] <> null then
begin
BN_DELXP.Enabled := true;
setlength(m_imagestr, 0);
m_imagestr := copy(cxGDBTVFA1.controller.FocusedRecord.Values[5], 1, inti);
m_JpegStream := tmemorystream.Create;
setlength(m_imagestr, inti);
m_JpegStream.WriteBuffer(m_imagestr[1], inti);
m_JpegStream.Position := 0;
if m_JpegStream.Size > 0 then
begin
Jpg := TJpegImage.Create;
try
Jpg.LoadFromStream(m_JpegStream);//出错位置
Image1.Picture.Graphic := Jpg;
Jpg.free;
except
Image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) + '/icon/NO_PIC.JPG');
end;
end;
m_JpegStream.Clear;
m_JpegStream.Free;
setlength(m_imagestr, 0);
end;
请问,哪个大侠知道是怎么回事? 如何解决!!!? 在线等~~~~~~~
EJPEG with message 'JPEG error #51'
我的代码如下:
if cxGDBTVFA1.controller.FocusedRecord.Values[5] <> null then
begin
BN_DELXP.Enabled := true;
setlength(m_imagestr, 0);
m_imagestr := copy(cxGDBTVFA1.controller.FocusedRecord.Values[5], 1, inti);
m_JpegStream := tmemorystream.Create;
setlength(m_imagestr, inti);
m_JpegStream.WriteBuffer(m_imagestr[1], inti);
m_JpegStream.Position := 0;
if m_JpegStream.Size > 0 then
begin
Jpg := TJpegImage.Create;
try
Jpg.LoadFromStream(m_JpegStream);//出错位置
Image1.Picture.Graphic := Jpg;
Jpg.free;
except
Image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) + '/icon/NO_PIC.JPG');
end;
end;
m_JpegStream.Clear;
m_JpegStream.Free;
setlength(m_imagestr, 0);
end;
请问,哪个大侠知道是怎么回事? 如何解决!!!? 在线等~~~~~~~