Exemple #1
0
        public Bitmap(int width, int height, PixelFormat format)
        {
            IntPtr bitmap = IntPtr.Zero;
            int    status = Gdip.GdipCreateBitmapFromScan0(width, height, 0, unchecked ((int)format), NativeMethods.NullHandleRef, out bitmap);

            Gdip.CheckStatus(status);

            SetNativeImage(bitmap);
        }
Exemple #2
0
        public Bitmap(int width, int height, int stride, PixelFormat format, IntPtr scan0)
        {
            IntPtr bitmap = IntPtr.Zero;
            int    status = Gdip.GdipCreateBitmapFromScan0(width, height, stride, unchecked ((int)format), new HandleRef(null, scan0), out bitmap);

            Gdip.CheckStatus(status);

            SetNativeImage(bitmap);
        }