Skip to content

Instantly share code, notes, and snippets.

@hagbarddenstore
Created October 8, 2013 09:00
Show Gist options
  • Save hagbarddenstore/6881783 to your computer and use it in GitHub Desktop.
Save hagbarddenstore/6881783 to your computer and use it in GitHub Desktop.
A small application to check the dimensions of an image.
// Compile with: C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /r:System.Drawing.dll /out:ImageSize.exe ImageSize.cs
// Use: ImageSize.exe MyImage.png
namespace ConsoleApplication1
{
public static class Program
{
public static void Main(string[] arguments)
{
var image = new System.Drawing.Bitmap(arguments[0]);
System.Console.WriteLine("Height: {0} Width: {1}", image.Size.Height, image.Size.Width);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment