Thank you
And how to load just picture?
Provide Lnet component with URL of "just picture", let's say:
http://www.mysite.com/image.pngif you don't know the exact address, you'll need to load an .html file and parse it... (that's how browsers work)
After you're sure that lnet is loading the picture (not .html), you can decide what to do with the data.
The Lnet component writes the data from ABuffer to a stream... let's say TMemoryStream or TFileStream (if you need to store the picture into a file).
If you need to show the picture on the screen you can later load and show it, using Graphics unit.
uses
...lnet, graphics...
var
pngstream: TStream;
pngimage : TPortableNetworkGraphics;
function TMainForm.HTTPClientInput(ASocket: TLHTTPClientSocket; ABuffer: pchar;
ASize: dword): dword;
begin
pngstream.Write(ABuffer^, ASize);
end;
procedure TMainForm.ShowPicture;
begin
if not Assigned(png) then begin
pngimage:=TPortableNetworkGraphics.Create;
pngstream.Position:=0;
pngimage.LoadFromStream(pngstream);
end;
Invalidate;
end;
procedure TMainForm.FormPaint;
begin
if Assigned(pngimage) then
Canvas.Draw(0,0,pngimage);
end;
It all depends on what you mean saying "how to load a picture". Lnet will help you to get the picture data, but it's up to you how to use it.
P.S. don't ask for the examples, write your own