Connecting Tech Pros Worldwide Forums | Help | Site Map

Load image from internet

Jeroen Timmers
Guest
 
Posts: n/a
#1: May 28 '06
I want to load an image from internet and put this image in a TImage.

When i used c# i have an open webstream.
Now i am new in this language and i could not find the correct stream.

thx





Kai-Uwe Bux
Guest
 
Posts: n/a
#2: May 28 '06

re: Load image from internet


Jeroen Timmers wrote:
[color=blue]
> I want to load an image from internet and put this image in a TImage.
>
> When i used c# i have an open webstream.
> Now i am new in this language and i could not find the correct stream.[/color]

The standard library for C++ has no streams or other facilities to handle
internet connections out of the box. You will need to use a third-party
library. There is a libraries FAQ regularly posted on this news group that
may contain useful pointers. May I suggest Google.

As third-party libraries (beyond acknowledging/cherishing their existence)
are off-topic in this forum, you may also try news groups dealing with your
platform. The FAQ and the Welcome post contain a few pointers to those.


Best

Kai-Uwe Bux

Phlip
Guest
 
Posts: n/a
#3: May 28 '06

re: Load image from internet


Jeroen Timmers wrote:
[color=blue]
> I want to load an image from internet and put this image in a TImage.
>
> When i used c# i have an open webstream.
> Now i am new in this language and i could not find the correct stream.[/color]

This newsgroup is not qualified to discuss details of downloading, or of
images, because we can only discuss raw C++ here, and it defines none of
those things; they are platform-specific. You did not even confess your
platform - but we can guess!

To boot you in the right direction, let's start absurdly simple, like this:

system("wget http://flea.sourceforge.net/ZeekLand0284.png");

Now use your Image class's file loading function to load that file.

Oddly enough, system() itself is on-topic. But the wget program isn't, and
if you posted this question to a group that discusses your Image class, they
might proudly instruct you to use a complex solution instead of wget. Always
start with a simple solution, because you might discover it's the best. If
you do, then you have one less module to worry about, and if you don't, then
the simple solution will buy time while you install a more complex one.

Use Google Groups to find your next newsgroup about this question.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


Closed Thread