public FramebufferData(IUnmanagedBlob data, int width, int height) { Data = data; Size = new PixelSize(width, height); var header = new UnmanagedMethods.BITMAPINFOHEADER(); header.Init(); header.biPlanes = 1; header.biBitCount = _bytesPerPixel * 8; header.Init(); header.biWidth = width; header.biHeight = -height; Header = header; }
public WindowFramebuffer(IntPtr handle, int width, int height) { if (width <= 0) { throw new ArgumentException("width is less than zero"); } if (height <= 0) { throw new ArgumentException("height is less than zero"); } _handle = handle; _bmpInfo.Init(); _bmpInfo.biPlanes = 1; _bmpInfo.biBitCount = 32; _bmpInfo.Init(); _bmpInfo.biWidth = width; _bmpInfo.biHeight = -height; _pBitmap = Marshal.AllocHGlobal(width * height * 4); }
public WindowFramebuffer(IntPtr handle, int width, int height) { if (width <= 0) { throw new ArgumentException("width is less than zero"); } if (height <= 0) { throw new ArgumentException("height is less than zero"); } _handle = handle; _bmpInfo.Init(); _bmpInfo.biPlanes = 1; _bmpInfo.biBitCount = 32; _bmpInfo.Init(); _bmpInfo.biWidth = width; _bmpInfo.biHeight = -height; _bitmapBlob = AvaloniaLocator.Current.GetService <IRuntimePlatform>().AllocBlob(width * height * 4); }
public WindowFramebuffer(IntPtr handle, PixelSize size) { if (size.Width <= 0) { throw new ArgumentException("Width is less than zero"); } if (size.Height <= 0) { throw new ArgumentException("Height is less than zero"); } _handle = handle; _bmpInfo.Init(); _bmpInfo.biPlanes = 1; _bmpInfo.biBitCount = 32; _bmpInfo.Init(); _bmpInfo.biWidth = size.Width; _bmpInfo.biHeight = -size.Height; _bitmapBlob = AvaloniaGlobals.RuntimePlatform.AllocBlob(size.Width * size.Height * 4); }