i want image dimension bmp,jpg,png and tiff
Thanks.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mohamed AbedallahPosted May 24, 2017, 8:45 AM
/**********************/
System.Drawing.Image _img = System.Drawing.Image.FromFile(@"C:\temp\Image1.TIF");
MessageBox.Show("Image Width:" + _img.Width.ToString() + Environment.NewLine + "Image Height:" + _img.Height.ToString());
/**********************/
Note that not all file formats are natively supported under .NET, so you may consider using a professional toolkit like LEADTOOLS, which is also easy to use. The following simple code shows how you can get the dimensions of an image:
/*************************/
RasterCodecs _codecs = new RasterCodecs();
CodecsImageInfo information = _codecs.GetInformation(@"C:\temp\Image1.TIF", true);
MessageBox.Show("Image Width:" + information.Width.ToString() + Environment.NewLine + "Image Height:" + information.Height.ToString());
/*************************/
Amit GuptaPosted May 23, 2017, 4:03 PM