Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Jul : Stream Read Error

www.cryer.info
Managed Newsgroup Archive

Stream Read Error

Subject:Stream Read Error
Posted by:"Monzer George Yazigi" (monzer_yazi..@hotmail.com)
Date:Fri, 25 Jul 2008 19:00:40 +0300

Dear All,
I need to copy the content of TMemoryStream to an TBArray =  Array of
Byte.

I have the following code, and I am getting Stream Read Error.

     MS:=TMemoryStream.Create;
     imgView.IO.SaveToStreamJpeg(MS);
     SZ:=MS.Size;
     SetLength(img,SZ);
     MS.ReadBuffer(img, SZ);

Where imgView is a TImageEn component that has a JPG file loaded
within it.

Any advise?

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive