Image1.ImageUrl="../../pro/"+ds.Tables[0].Rows[0][2].ToString();
try
{
string imgPath=Server.MapPath("../../img/"+ds.Tables[0].Rows[0][2].ToString()).ToString();
System.Drawing.Image image = System.Drawing.Image.FromFile(imgPath);
double h=Convert.ToDouble(image.Height.ToString());
double w=Convert.ToDouble(image.Width.ToString());
double f=h/w;
if(h>w)
{
if(h>550)
{
h=550;
w=550*(1/f);
}
}
else if(w>h)
{
if(w>550)
{
w=550;
h=550*f;
}
}
Image1.Height=Convert.ToInt32(h);
Image1.Width=Convert.ToInt32(w);
}
catch
{
}