using System.Runtime.InteropServices; namespace ScreenConnect; public class RawBitmap : RootBitmap { public RawBitmap(PixelModel pixelModel, int width, int height) : this(pixelModel, width, height, pixelModel.BytesPerPixel * width) { } public RawBitmap(PixelModel pixelModel, int width, int height, int stride) : base(pixelModel, width, height, stride, Marshal.AllocHGlobal(stride * height)) { } protected override void Dispose(bool disposing) { Marshal.FreeHGlobal(base.Scan0); } }