CLNUIDeviceTest.NUIImage.NUIImage C# (CSharp) Method

NUIImage() public method

public NUIImage ( int width, int height ) : System
width int
height int
return System
        public NUIImage(int width, int height)
        {
            uint imageSize = (uint)width * (uint)height * 4;
            // create memory section and map
            _section = CreateFileMapping(new IntPtr(-1), IntPtr.Zero, 0x04, 0, imageSize, null);
            _map = MapViewOfFile(_section, 0xF001F, 0, 0, imageSize);
            BitmapSource = Imaging.CreateBitmapSourceFromMemorySection(_section, width, height, PixelFormats.Bgr32, width * 4, 0) as InteropBitmap;
        }