private void BetaMassImport() { //MAKE SURE TO INCLUDE A METHOD TO USE EXTRA PALETTES, AND ONE TO NOT USE THEM! //First, make the new palette PaletteMedianCutAnalyzer paletteMaker = new PaletteMedianCutAnalyzer(); foreach (BitmapWrapper wrapper in lbNewImages.Items) { for (int i = 0; i < wrapper.Image.Width; i++) { for (int j = 0; j < wrapper.Image.Height; j++) { paletteMaker.AddColor(wrapper.Image.GetPixel(i, j)); } } } Color[] colors = paletteMaker.GetPalette(0xC0); byte[] paletteData = TextureConversion.PaletteToBinary(colors); Palette palette = new Palette(-1, paletteData); Kart.SetMainPalette(palette); //Convert all existing images List <string> orderedKartNames = GetNewImageNames(); CreateAllKartImages(); BetaSetUpAnimations(orderedKartNames); }
private void CreateNewKartPalette() { //MAKE SURE TO INCLUDE A METHOD TO USE EXTRA PALETTES, AND ONE TO NOT USE THEM! PaletteMedianCutAnalyzer paletteMaker = new PaletteMedianCutAnalyzer(); foreach (BitmapWrapper wrapper in lbNewImages.Items) { for (int i = 0; i < wrapper.Image.Width; i++) { for (int j = 0; j < wrapper.Image.Height; j++) { paletteMaker.AddColor(wrapper.Image.GetPixel(i, j)); } } } Color[] colors = paletteMaker.GetPalette(0xC0); byte[] paletteData = TextureConversion.PaletteToBinary(colors); Palette palette = new Palette(-1, paletteData); Kart.SetMainPalette(palette); //Convert all existing images CreateAllKartImages(); }