Exemplo n.º 1
0
        public Bitmap(int width, int height, Graphics g)
        {
            ArgumentNullException.ThrowIfNull(g);

            IntPtr bitmap;
            int    status = Gdip.GdipCreateBitmapFromGraphics(width, height, new HandleRef(g, g.NativeGraphics), out bitmap);

            Gdip.CheckStatus(status);

            SetNativeImage(bitmap);
        }
Exemplo n.º 2
0
        public Bitmap(int width, int height, Graphics g)
        {
            if (g == null)
            {
                throw new ArgumentNullException(nameof(g));
            }

            IntPtr bitmap = IntPtr.Zero;
            int    status = Gdip.GdipCreateBitmapFromGraphics(width, height, new HandleRef(g, g.NativeGraphics), out bitmap);

            Gdip.CheckStatus(status);

            SetNativeImage(bitmap);
        }