How to download a picture from internet and display it gradually?

Login to reply to this topic.
Mon, 2007-07-23 04:45
Joined: 2007-06-20
Forum posts: 26

I'd like to download a picture from internet and display it gradually, just like what the Internet Explorer in Windows usually does. It's like streaming. How to realize this?


Mon, 2007-07-23 08:06
Joined: 2005-11-20
Forum posts: 1093
Re: How to download a picture from internet...

As far as I know there is no direct support for something like this in Symbian. All the classes that deal with pictures that I know of want to process a complete picture.

I guess this gradual picture display will be very complicated to program...


René Brunner

Mon, 2007-07-23 08:16
Joined: 2007-06-21
Forum posts: 82
Re: How to download a picture from internet and display it gradu

Well, its a very generic question. Let me answer with what I did for this kind of thing.
There are two problems:
1. Download the photo from internet.
Say for example, your photo is at www.xyz.com/my_photo.jpg. Now you need two things for this:
a)Http Client to do a GET on this address --> Pls see example HttpEngine widely available for symbian. I guess it's in one of s60 examples too.You will hae to do IssueHTTPGetL with the address of ur image.
b)ImageDecoder to convert jpg/gif/bla bla format to Bitmap, wich you can embed in symbian controls. --> See example in OpenGLEx in S60Examples.

2. Display that photo on device
this depends on what control you use. Now as you mentioned, like IE does, so the best wud be CEikImage.

In .hpp
                CEikImage*                iFriendImage;

in Your view .cpp
   -In ConstruclL
        //Initialing Image Control
        iFriendImage = new (ELeave) CEikImage();
        iFriendImage->SetContainerWindowL(*this);

where you wanna show the image:

                //Friends Picture
                iFriendImage->SetBitmap(bitmap);
                iFriendImage->SetPictureOwnedExternally(ETrue);
                iFriendImage->MakeVisible(ETrue);                                               

You can see API docs for more on CEikImage.

Br
G;p

Mon, 2007-07-23 09:16
Joined: 2007-06-20
Forum posts: 26
Re: How to download a picture from internet and display it gradu

To singhgupi,

Thanks for your reply.

But I have something I can't quite understand. If the file is partially downloaded, can the file be displayed partially? If the file is incomplete, can it be converted to a bitmap?

Mon, 2007-07-23 14:23
Joined: 2007-06-21
Forum posts: 82
Re: How to download a picture from internet and display it gradu

If the file is partially downloaded, can the file be displayed partially? If the file is incomplete, can it be converted to a bitmap?

Oops, I misunderstood your requirement. I don't think that's possible. Do you want to partially download/display the image, as it's quite big???
In my case, I'm downloading the images from my own server. So, I have put logic of resizing, etc of images in my server. Hence, for mobile, images are always small, and they are downloaded quite fast. But, if it's not ur server, then client has to do it. But I can think of only fully downloading the image and displaying it. I can't think of any way where partial download/display is possible
Sad

  • Login to reply to this topic.