Exemple #1
0
        private void Accept_Click(object sender, EventArgs e)
        {
            pal = new Dictionary <Int32, byte>();
            int c;

            for (byte i = 0; i < 16; i++)
            {
                PaletteId a = ColorPalette.SelectedPalette;
                c = ColorPalette.GetGlobalColor(i).ToArgb();
                if (!pal.ContainsKey(c))
                {
                    pal.Add(c, i);
                }
            }
            NewFrames.Clear();
            try
            {
                NewFrames = ImageProcessor.FromSpriteSheetToFrames(bps, mx, my, pal, name.Text, DynamicSpriteSizeDialog.DynSize, ColorPalette.SelectedPalette);
            }
            catch (KeyNotFoundException)
            {
                MessageBox.Show("A color on the image, doesn't exist on the color palette. Please load the palette of the image.",
                                "Color Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            DialogResult = DialogResult.OK;
            FrameWidth   = (int)w.Value;
            FrameHeight  = (int)h.Value;
            Dispose();
        }
Exemple #2
0
 void RaiseNewFrameNumber() => NewFrames?.Invoke(this, new NewFramesEventArgs(NewFramesKind.NewFrameNumber));
Exemple #3
0
 void RaiseClearFrames() => NewFrames?.Invoke(this, new NewFramesEventArgs(NewFramesKind.Cleared));