Esempio n. 1
0
        public static void Init()
        {
            using (Bitmap tmp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
                Palette = tmp.Palette;
            Bitmap[] bmplist = { Properties.Resources.red, Properties.Resources.blue, Properties.Resources.bumper, Properties.Resources.ring, Properties.Resources.yellow };
            int      palind  = 1;

            for (int i = 0; i < bmplist.Length; i++)
            {
                bmplist[i].Palette.Entries.CopyTo(Palette.Entries, palind);
                BitmapBits bmp = new BitmapBits(bmplist[i]);
                bmp.IncrementIndexes(palind);
                SphereBmps[(SphereType)(i + 1)] = bmp;
                palind += 16;
            }
            Palette.Entries[0] = Palette.Entries[1] = Color.Transparent;
            bmplist            = new[] { Properties.Resources.north, Properties.Resources.west, Properties.Resources.south, Properties.Resources.east };
            bmplist[0].Palette.Entries.CopyTo(Palette.Entries, palind);
            for (int i = 0; i < bmplist.Length; i++)
            {
                BitmapBits bmp = new BitmapBits(bmplist[i]);
                bmp.IncrementIndexes(palind);
                StartBmps[i] = bmp;
            }
        }