if I execute following code, everything is ok
var
tmpfilename:string;
begin
tmpfilename :='this_is_temp_file';
MySybasetable.MyBLOBImageColume.SavetoFile(tmpfilename);
MyImage.picture.LoadFromFile(tmpfilename);
...
but I'd like to access the data via stream, so I change the code, it
look like this:
var
Mystream :TMemoryStream;
begin
Mystream:=TMemoryStream.Create;
MySybasetable.MyImageColume.SavetoStream(MyStream);
MyImage.picture.graphic.LoadFromstream(Mystream); <-----------
....
When the application execute to the <-----, system generate a
Access violation error, I don't know why, can anyone help me ?
is there any other method to load a jpeg image from a stream to
a TImage component?
thx in advance
Simon
<SNIP>
>
Jay,
> var
> Mystream :TMemoryStream;
> begin
> Mystream:=TMemoryStream.Create;
> MySybasetable.MyImageColume.SavetoStream(MyStream);
Mystream.Position:=0;
> MyImage.picture.graphic.LoadFromstream(Mystream); <-----------
"Simon Wang" <sim...@online.sh.cn> wrote in message
news:6oudss495jasd5vgi...@4ax.com...
> Hi
> In my application , I need to load a jpg image from a sybase table
> to a TImage.
>
> if I execute following code, everything is ok
>
> var
> tmpfilename:string;
> begin
> tmpfilename :='this_is_temp_file';
> MySybasetable.MyBLOBImageColume.SavetoFile(tmpfilename);
> MyImage.picture.LoadFromFile(tmpfilename);
> ...
>
Perhaps Steve Schafer's post from Oct 1999 will help:
http://www.deja.com/getdoc.xp?AN=531776048
--
efg
Earl F. Glynn E-mail: ef...@efg2.com
Overland Park, KS USA
efg's Computer Lab: http://www.efg2.com/Lab
is invalid. but ..... How can I load a picture to TImage
From a Stream? the TImage.Picture only have LoadFromFile
method and do not support LoadFromStream method.
thx
Simon
Mystream:=TMemoryStream.Create;
MySybasetable.MyImageColume.SavetoStream(MyStream);
MyStream.Position := 0;
MyImage.picture.Bitmap.LoadFromStream( MyStream );
Simon Wang <sim...@online.sh.cn> wrote in message
news:3g2gssc0a5i6dbglq...@4ax.com...
I read the doc in deja, that do can help me .
regards
Simon