BackImage Stream and clear
Posted: Thu Feb 24, 2011 8:33 am
Hello
D2007 and TeeTree VCL 8.04
I load BackImage from Stream, it's Ok that good result with under methode
function LoadBackImageFromStream:Boolean;
Var i:integer;
jpg: TJPEGImage;
Stream1:TMemoryStream;
begin
try
Stream1:=TMemoryStream.Create;
jpg:=TJPEGImage.Create;
try
Stream1:=GetStreamImageFromSever; //Load Stream from my server by Webservice > it's Ok
if Stream1.size>=0 then
jpg.LoadFromStream(Stream1);
Tree1.BackImage.Assign(jpg);
finally
FreeAndNil(jpg);
FreeAndNil(Stream1);
end;
except
//managment error
end;
end;
Q1) do hou have other solution for direct load image by stream, without TJPEGImage and without file disk?
Q2) How do take for clear Image if my stream is empty or bad ?
Q3) do you have best practice and géneral méthode for image (jpeg,bmp,Gif etc) without file disk ?
D2007 and TeeTree VCL 8.04
I load BackImage from Stream, it's Ok that good result with under methode
function LoadBackImageFromStream:Boolean;
Var i:integer;
jpg: TJPEGImage;
Stream1:TMemoryStream;
begin
try
Stream1:=TMemoryStream.Create;
jpg:=TJPEGImage.Create;
try
Stream1:=GetStreamImageFromSever; //Load Stream from my server by Webservice > it's Ok
if Stream1.size>=0 then
jpg.LoadFromStream(Stream1);
Tree1.BackImage.Assign(jpg);
finally
FreeAndNil(jpg);
FreeAndNil(Stream1);
end;
except
//managment error
end;
end;
Q1) do hou have other solution for direct load image by stream, without TJPEGImage and without file disk?
Q2) How do take for clear Image if my stream is empty or bad ?
Q3) do you have best practice and géneral méthode for image (jpeg,bmp,Gif etc) without file disk ?