Ejemplo n.º 1
0
        public BITMAPINFOHEADER(int width, int height, ushort bpp)
        {
            biSize          = (uint)Marshal.SizeOf(typeof(BITMAPINFOHEADER)); // BITMAPINFOHEADER < DIBV5 is 40 bytes
            biPlanes        = 1;                                              // Should allways be 1
            biCompression   = BI_COMPRESSION.BI_RGB;
            biWidth         = width;
            biHeight        = height;
            biBitCount      = bpp;
            biSizeImage     = (uint)(width * height * (bpp >> 3));
            biXPelsPerMeter = 0;
            biYPelsPerMeter = 0;
            biClrUsed       = 0;
            biClrImportant  = 0;

            // V5
            bV5RedMask               = (uint)255 << 16;
            bV5GreenMask             = (uint)255 << 8;
            bV5BlueMask              = (uint)255;
            bV5AlphaMask             = (uint)255 << 24;
            bV5CSType                = 1934772034; // sRGB
            bV5Endpoints             = new CIEXYZTRIPLE();
            bV5Endpoints.ciexyzBlue  = new CIEXYZ(0);
            bV5Endpoints.ciexyzGreen = new CIEXYZ(0);
            bV5Endpoints.ciexyzRed   = new CIEXYZ(0);
            bV5GammaRed              = 0;
            bV5GammaGreen            = 0;
            bV5GammaBlue             = 0;
            bV5Intent                = 4;
            bV5ProfileData           = 0;
            bV5ProfileSize           = 0;
            bV5Reserved              = 0;
        }
Ejemplo n.º 2
0
        public BITMAPINFOHEADER(int width, int height, ushort bpp)
        {
            biSize = (uint)Marshal.SizeOf(typeof(BITMAPINFOHEADER));    // BITMAPINFOHEADER < DIBV5 is 40 bytes
            biPlanes = 1;   // Should allways be 1
            biCompression = BI_COMPRESSION.BI_RGB;
            biWidth = width;
            biHeight = height;
            biBitCount = bpp;
            biSizeImage = (uint)(width * height * (bpp >> 3));
            biXPelsPerMeter = 0;
            biYPelsPerMeter = 0;
            biClrUsed = 0;
            biClrImportant = 0;

            // V5
            bV5RedMask = (uint)255 << 16;
            bV5GreenMask = (uint)255 << 8;
            bV5BlueMask = (uint)255;
            bV5AlphaMask = (uint)255 << 24;
            bV5CSType = 1934772034; // sRGB
            bV5Endpoints = new CIEXYZTRIPLE
            {
                ciexyzBlue = new CIEXYZ(0),
                ciexyzGreen = new CIEXYZ(0),
                ciexyzRed = new CIEXYZ(0)
            };
            bV5GammaRed = 0;
            bV5GammaGreen = 0;
            bV5GammaBlue = 0;
            bV5Intent = 4;
            bV5ProfileData = 0;
            bV5ProfileSize = 0;
            bV5Reserved = 0;
        }