Пример #1
0
        public static RGBQUAD[] StandarizePalette(RGBQUAD[] palette)
        {
            RGBQUAD[] newPalette = new RGBQUAD[256];
            for(int i=0; i<palette.Length; i++)
                newPalette[i] = palette[i];

            return newPalette;
        }
Пример #2
0
        public static RGBQUAD[] StandarizePalette(RGBQUAD[] palette)
        {
            RGBQUAD[] newPalette = new RGBQUAD[256];
            for (int i = 0; i < palette.Length; i++)
            {
                newPalette[i] = palette[i];
            }

            return(newPalette);
        }
Пример #3
0
 public static RGBQUAD[] RGBQUADFromColorArray(Bitmap bmp)
 {
     // Some programs as Axialis have problems with a reduced palette, so lets create a full palette
     int bits = Tools.BitsFromPixelFormat(bmp.PixelFormat);
     RGBQUAD[] rgbArray = new RGBQUAD[bits <= 8 ? (1 << bits) : 0];
     Color[] entries = bmp.Palette.Entries;
     for(int i=0; i<entries.Length; i++)
     {
         rgbArray[i].rgbRed  = entries[i].R;
         rgbArray[i].rgbGreen= entries[i].G;
         rgbArray[i].rgbBlue = entries[i].B;
     }
     return rgbArray;
 }
Пример #4
0
        public static RGBQUAD[] RGBQUADFromColorArray(Bitmap bmp)
        {
            // Some programs as Axialis have problems with a reduced palette, so lets create a full palette
            int bits = Tools.BitsFromPixelFormat(bmp.PixelFormat);

            RGBQUAD[] rgbArray = new RGBQUAD[bits <= 8 ? (1 << bits) : 0];
            Color[]   entries  = bmp.Palette.Entries;
            for (int i = 0; i < entries.Length; i++)
            {
                rgbArray[i].rgbRed   = entries[i].R;
                rgbArray[i].rgbGreen = entries[i].G;
                rgbArray[i].rgbBlue  = entries[i].B;
            }
            return(rgbArray);
        }
Пример #5
0
 public static bool CompareRGBQUADToColor(RGBQUAD rgbQuad, Color color)
 {
     return rgbQuad.rgbRed == color.R && rgbQuad.rgbGreen == color.G && rgbQuad.rgbBlue == color.B;
 }
Пример #6
0
 public static bool CompareRGBQUADToColor(RGBQUAD rgbQuad, Color color) => rgbQuad.rgbRed == color.R && rgbQuad.rgbGreen == color.G && rgbQuad.rgbBlue == color.B;
Пример #7
0
 public unsafe static extern void CopyMemory(RGBQUAD* dest, byte* src, int cb);