public static Graphics FromImage(Image image) { if (image == null) { throw new ArgumentNullException("image"); } IntPtr native = LibIGraph.GetGraphicsFromImage(image.native); if (native == IntPtr.Zero) { throw new ArgumentException("Failed to get Graphics from given Image", "image"); } return(new Graphics(image.Width, image.Height, image.PixelFormat, native)); }