获取图片长度和宽度

 

 

string strFilePath = "~/ckeditor/userfiles/OA/CYJD/" + dr["ActivityPhoto"];
System.Drawing.Image pic = System.Drawing.Image.FromFile(Server.MapPath(strFilePath));//strFilePath是该图片的绝对路径
int intWidth = 150;//长度像素值
int intHeight = (int)(pic.Height * 1.0 * (150.0 / pic.Width));//高度像素值

  

 

posted @ 2016-02-22 10:30  linyongqin  阅读(192)  评论(0)    收藏  举报