I\'m using asp.net 3.5 and c# on my web site. Here is my question:
I have an upload button and asp:Image on a page. An user can upload an image from his computer and
Try this.
public boolean CheckImgDimensions(string imgPath, int ValidWidth , int ValidHeight){ var img = Image.FromFile(Server.MapPath(imgPath)); return (img.width == ValidWidth && img.height == ValidHeight ); }
Use:
if ( CheckImgDimensions("~/Content/img/MyPic.jpg",128,128) ){ /// what u want }