Esempio n. 1
0
        public override NSImage GetImage()
        {
            var copy = new BitmapHandler();

            copy.Create(size.Width, size.Height, PixelFormat.Format32bppRgb);
            CopyTo(copy, new Rectangle(size));
            return(copy.Control);
        }
Esempio n. 2
0
        public void Create(int width, int height, int bitsPerPixel)
        {
            this.bitsPerPixel = bitsPerPixel;
            bytesPerRow       = width * bitsPerPixel / 8;
            int colorCount = (int)Math.Pow(2, bitsPerPixel);

            colors = new int[colorCount];
            for (int i = 0; i < colorCount; i++)
            {
                colors[i] = unchecked ((int)0xffffffff);
            }

            size = new Size(width, height);
            ptr  = Marshal.AllocHGlobal(height * bytesPerRow);
            //Control = new byte[height * bytesPerRow];
            bmp = new BitmapHandler();
            bmp.Create(size.Width, size.Height, PixelFormat.Format32bppRgb);
        }