예제 #1
0
        private TimPalettes(TimPalettesHeader palettesHeader, BitmapPalette[] palettes)
        {
            Exceptions.CheckArgumentNull(palettesHeader, "palettesHeader");
            Exceptions.CheckArgumentNull(palettes, "palettes");

            PalettesHeader = palettesHeader;
            Palettes       = palettes;
        }
예제 #2
0
 private static BitmapPalette ReadPalette(TimPalettesHeader palettesHeader, Stream input)
 {
     byte[]  buff   = new byte[2];
     Color[] colors = new Color[palettesHeader.ColorsPerPalette];
     for (int i = 0; i < colors.Length; i++)
     {
         colors[i] = ColorsHelper.ReadColor(input, buff);
     }
     return(new BitmapPalette(colors));
 }
예제 #3
0
        private static TimPalettes Read(TimHeader header, Stream input)
        {
            TimPalettesHeader palettesHeader = TimPalettesHeader.Read(input);

            BitmapPalette[] palettes = new BitmapPalette[palettesHeader.PalettesCount];
            for (int i = 0; i < palettes.Length; i++)
            {
                palettes[i] = ReadPalette(palettesHeader, input);
            }
            return(new TimPalettes(palettesHeader, palettes));
        }