Is it possible to pull an image from the internet? Like having a small window, which will just be an image from the internet. And if the internet image changes, the clientside image should as well. How would one go about doing this?
Well to go through a web server you have to poll since HTTP is not a session based protocol. Then of course you have to be able to consume the image data and render it to your device context.
In Visual C++ using MFC it’s fairly simple using the CInternetSession etc. classes to obtain the resource if you have an URL for it.
After that you have to be able to render it in your window which is a whole other issue and not so simple since different image formats are involved. There is a COM control that can be used to render JPEG and maybe even GIF files I can’t remember for sure. It uses a COM IStream interface I think. It’s been several years since I worked with it. I don’t remember what platforms it is available in. You can get all the information including sample code on MSDN.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.