public BITMAPINFOHEADER(int width, int height, ushort bpp) { biSize = (uint)Marshal.SizeOf(typeof(BITMAPINFOHEADER)); biPlanes = 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; bV5RedMask = (uint)255 << 16; bV5GreenMask = (uint)255 << 8; bV5BlueMask = (uint)255; bV5AlphaMask = (uint)255 << 24; bV5CSType = 1934772034; 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; }
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 = 255; bV5AlphaMask = (uint)255 << 24; bV5CSType = 0x73524742; // LCS_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; }
public void PopulateWithData(byte[] data, int StartAddress) { biSize = BitConverter.ToUInt32(data, StartAddress + 0); //4 biWidth = BitConverter.ToInt32(data, StartAddress + 4); //8 biHeight = BitConverter.ToInt32(data, StartAddress + 8); //12 biPlanes = BitConverter.ToUInt16(data, StartAddress + 12); //14 biBitCount = BitConverter.ToUInt16(data, StartAddress + 14); //16 biCompression = (BI_COMPRESSION)BitConverter.ToUInt32(data, StartAddress + 16); //20 biSizeImage = BitConverter.ToUInt32(data, StartAddress + 20); //24 biXPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 24); //28 biYPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 28); //32 biClrUsed = BitConverter.ToUInt32(data, StartAddress + 32); //36 biClrImportant = BitConverter.ToUInt32(data, StartAddress + 36); //40 }
public void PopulateWithData(byte[] data, int StartAddress) { bV5Size = BitConverter.ToUInt32(data, StartAddress + 0); //4 bV5Width = BitConverter.ToInt32(data, StartAddress + 4); //8 bV5Height = BitConverter.ToInt32(data, StartAddress + 8); //12 bV5Planes = BitConverter.ToUInt16(data, StartAddress + 12); //14 bV5BitCount = BitConverter.ToUInt16(data, StartAddress + 14); //16 bV5Compression = ( BI_COMPRESSION)BitConverter.ToInt32(data, StartAddress + 16); //20 bV5SizeImage = BitConverter.ToUInt32(data, StartAddress + 20); //24 bV5XPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 24); //28 bV5YPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 28); //32 bV5ClrUsed = BitConverter.ToUInt32(data, StartAddress + 32); //36 bV5ClrImportant = BitConverter.ToUInt32(data, StartAddress + 36); //40 bV5RedMask = BitConverter.ToUInt32(data, StartAddress + 40); //44 bV5GreenMask = BitConverter.ToUInt32(data, StartAddress + 44); //48 bV5BlueMask = BitConverter.ToUInt32(data, StartAddress + 48); //52 bV5AlphaMask = BitConverter.ToUInt32(data, StartAddress + 52); //56 bV5CSType = BitConverter.ToUInt32(data, StartAddress + 56); //60 bV5Endpoints = new CIEXYZTRIPLE(); bV5Endpoints.PopulateWithData(data, 60); //96 bV5GammaRed = BitConverter.ToUInt32(data, StartAddress + 96); //100 bV5GammaGreen = BitConverter.ToUInt32(data, StartAddress + 100); //104 bV5GammaBlue = BitConverter.ToUInt32(data, StartAddress + 104); //108 bV5Intent = BitConverter.ToUInt32(data, StartAddress + 108); //112 bV5ProfileData = BitConverter.ToUInt32(data, StartAddress + 112); //116 bV5ProfileSize = BitConverter.ToUInt32(data, StartAddress + 116); //120 bV5Reserved = BitConverter.ToUInt32(data, StartAddress + 120); //124 }
public void PopulateWithData(byte[] data, int StartAddress) { bV4Size = BitConverter.ToUInt32(data, StartAddress + 0); //4 bV4Width = BitConverter.ToInt32(data, StartAddress + 4); //8 bV4Height = BitConverter.ToInt32(data, StartAddress + 8); //12 bV4Planes = BitConverter.ToUInt16(data, StartAddress + 12); //14 bV4BitCount = BitConverter.ToUInt16(data, StartAddress + 14); //16 bV4V4Compression = ( BI_COMPRESSION)BitConverter.ToInt32(data, StartAddress + 16); //20 bV4SizeImage = BitConverter.ToUInt32(data, StartAddress + 20); //24 bV4XPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 24); //28 bV4YPelsPerMeter = BitConverter.ToInt32(data, StartAddress + 28); //32 bV4ClrUsed = BitConverter.ToUInt32(data, StartAddress + 32); //36 bV4ClrImportant = BitConverter.ToUInt32(data, StartAddress + 36); //40 bV4RedMask = BitConverter.ToUInt32(data, StartAddress + 40); //44 bV4GreenMask = BitConverter.ToUInt32(data, StartAddress + 44); //48 bV4BlueMask = BitConverter.ToUInt32(data, StartAddress + 48); //52 bV4AlphaMask = BitConverter.ToUInt32(data, StartAddress + 52); //56 BV4CsType = BitConverter.ToUInt32(data, StartAddress + 56); //60 bV4Endpoints = new CIEXYZTRIPLE(); bV4Endpoints.PopulateWithData(data, 60); //96 bV4GammaRed = BitConverter.ToUInt32(data, StartAddress + 96); //100 bV4GammaGreen = BitConverter.ToUInt32(data, StartAddress + 100); //104 bV4GammaBlue = BitConverter.ToUInt32(data, StartAddress + 104); //108 }
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; }