获取图片长度和宽度
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));//高度像素值

浙公网安备 33010602011771号