Beispiel #1
0
        public static RGBQUAD FromRGBA(byte r, byte g, byte b, byte a)
        {
            RGBQUAD output = FromRGB(r, g, b);

            output.rgbReserved = a;
            return(output);
        }
Beispiel #2
0
        public void Read(BinaryReader Reader)
        {
            icHeader = new BITMAPINFOHEADER();
            icHeader.Read(Reader);
            icColors = new RGBQUAD[icHeader.biClrUsed != 0 ?
                                   icHeader.biClrUsed :
                                   icHeader.biBitCount <= 8 ?
                                   (uint)(1 << icHeader.biBitCount) : 0];
            for (int i = 0; i < icColors.Length; i++)
            {
                RGBQUAD rgb = new RGBQUAD();
                rgb.Read(Reader);
                icColors[i] = rgb;
            }
            if (icColors.Length == 0)
            {
                icColors = null;
            }
            int datalenght = (int)(Reader.BaseStream.Length - Reader.BaseStream.Position);

            icXOR = new byte[XorStride * Height];
            Reader.Read(icXOR, 0, icXOR.Length);
            if (icXOR.Length == datalenght)
            {
                icAND = null;
            }
            else
            {
                icAND = new byte[AndStride * Height];
                Reader.Read(icAND, 0, icAND.Length);
            }
        }
Beispiel #3
0
        public static RGBQUAD FromRGB(byte r, byte g, byte b)
        {
            RGBQUAD output = new RGBQUAD();

            output.rgbRed      = r;
            output.rgbGreen    = g;
            output.rgbBlue     = b;
            output.rgbReserved = 255;
            return(output);
        }