Home / Code Snippets / Blog article: Get Width And Height Of Image In C#

| RSS

Get Width And Height Of Image In C#

March 31st, 2009 | No Comments | Posted in Code Snippets

To get width and height of an image we can use System.Drawing.Image class. This code snippet shows how to retrieve width and height of an image.

string filePath = @"c:\deepak\MeeGo.jpg";
Image img = Image.FromFile(filePath);
 
Console.WriteLine(string.Format("Height: {0}",img.Size.Height));
 
Console.WriteLine(string.Format("Width: {0}",img.Size.Width));

Leave a Reply 6180 views, 1 so far today |
  • No Related Post

Leave a Reply