public static Image FromFile(string filename) { if (string.IsNullOrEmpty(filename)) { throw new ArgumentNullException("filename"); } int width, height; PixelFormat pixelFormat; IntPtr native = LibIGraph.BitmapFromFile(filename, out width, out height, out pixelFormat); return(new Bitmap(native, width, height, pixelFormat)); }