Link to home
Start Free TrialLog in
Avatar of huferry
huferryFlag for Netherlands

asked on

Parse web images from HTTP

Hi,

I'm trying to load jpg images from a web server.
I have succeeded to send the GET command to the
web server, and after that I get these lines:

..
..
Content-type: image/jpg
Content-length: 26232

(... binaries....)

I'm trying to save/parse the binaries to a jpg file
but I do not know how, can anyone help me?

It is important that I program on this level, and
not on higher level by using a web image component
because I in the future I have to parse streaming
images through the web.

regards,
huferry
Avatar of User137
User137

Would this component be handy? It can download any files silently from internet, it's free and source included. At least it may have something to learn from...
HTTPGet at: http://www.utilmind.com/
ASKER CERTIFIED SOLUTION
Avatar of JDuncan
JDuncan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eddie Shipman
Apparently he is using WinInet functions. I have no idea how to do that using WinInet.
To use wininet to download files from the net use the function

InternetReadFile(handle,addr(buffer),sizeof(buffer),BytesRead);

Where handle is returned by InternetOpenUrl function.

You decide how many bytes to read at atime by setting the buffer size.
and you can write the buffer to a file or filestream , maybe directly to the jpeg stream

I worked on this question some time ago , it has code for uploading downloading files via wininet.


https://www.experts-exchange.com/questions/20763209/WiniNet.html#9765274