获得图片的宽度和高度
2017-02-14 12:28:45 访问(1517) 赞(0) 踩(0)
protected int GetImageW(string imageFileName)
{
try
{
System.Drawing.Image img
=
System.Drawing.Image.FromFile(imageFileName);
int theResult = img.Width;
img.Dispose();
return theResult;
}
catch
{
return 0;
}
}
protected int GetImageH(string imageFileName)
{
try
{
System.Drawing.Image img
=
System.Drawing.Image.FromFile(imageFileName);
int theResult = img.Height;
img.Dispose();
return theResult;
}
catch
{
return 0;
}
}
标签:
获得图片的宽度和高度 


上一条:
下一条:
相关评论
发表评论