huferry
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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,ad dr(buffer) ,sizeof(bu ffer),Byte sRead);
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
InternetReadFile(handle,ad
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
HTTPGet at: http://www.utilmind.com/