public override NSImage GetImage() { var copy = new BitmapHandler(); copy.Create(size.Width, size.Height, PixelFormat.Format32bppRgb); CopyTo(copy, new Rectangle(size)); return(copy.Control); }
public void Create(int width, int height, int bitsPerPixel) { bytesPerRow = width * bitsPerPixel / 8; int colorCount = (int)Math.Pow(2, bitsPerPixel); colors = new uint[colorCount]; for (int i = 0; i < colorCount; i++) { colors [i] = 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); }