469,576 Members | 1,834 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,576 developers. It's quick & easy.

Performance issue with loading image from url

i have a need to load image from URL. the image is really small (gif) and i
use the following code.

but the code is too slow any1 have any alternative way(S)?
here is the url
http://phone.avioninc.com/asterisk/w...oneringing.gif

-----------------------here is the performance counter out put when i use
the code .--------------------------------

creating extensions -----------------
creating extensions Done ------------------ 3.34650549161975
creating extensions -----------------
creating extensions Done ------------------ 0.192390932367103
creating extensions -----------------
creating extensions Done ------------------ 0.185763833112868
creating extensions -----------------
creating extensions Done ------------------ 0.186087058550738
creating extensions -----------------
creating extensions Done ------------------ 0.187169039640513
--------------------------here is the performance counter output when i DO
NOT use the code.--------------------------------
creating extensions -----------------
creating extensions Done ------------------ 0.0457695042246989
creating extensions -----------------
creating extensions Done ------------------ 0.0147314812357436
creating extensions -----------------
creating extensions Done ------------------ 0.0162037353909505
creating extensions -----------------
creating extensions Done ------------------ 0.0166747449745708
creating extensions -----------------
creating extensions Done ------------------ 0.0188892722399076
creating extensions -----------------
creating extensions Done ------------------ 0.0150602939759103
creating extensions -----------------
creating extensions Done ------------------ 0.0156684718309171
-------------------- CODE ------------------------
private void SetCallerId(string url)
{
try
{
if(url == null)
{
CallerPicture.Image = null;
return;
}

Stream s = MakeStream(url);
if(s != null)
{
Bitmap temp = new Bitmap(s);
Bitmap image = new Bitmap(temp);
temp.Dispose();
s.Close();
CallerPicture.Image = image;
}
else
CallerPicture.Image = null;
CallerPicture.Refresh();
}
catch
{
return;
}
}
Nov 17 '05 #1
1 1528
Raj Chudasama <raj@asteriasgi_spamkiller.com> wrote:
i have a need to load image from URL. the image is really small (gif) and i
use the following code.


<snip>

Well, you haven't given the code for MakeStream, which could well be
significant...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Scott | last post: by
16 posts views Thread by David W. Fenton | last post: by
4 posts views Thread by Martin | last post: by
reply views Thread by James Dean | last post: by
4 posts views Thread by smoody | last post: by
7 posts views Thread by James | last post: by
4 posts views Thread by Gregory.A.Book | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.