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;
}
}