Exemplo n.º 1
0
        void ImportFramesFromImage(object o, EventArgs e)
        {
            using (ImportFramesDialog dlg = new ImportFramesDialog()) {
                DialogResult result = dlg.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Bitmap[] frames = dlg.ImportFrames();

                    // Build monster command thing
                    GroupCommand cmd = new GroupCommand();
                    for (int i = 0; i < frames.Length; i++)
                    {
                        cmd.AddCommand(new InsertFrameCommand(document.Frames.Count + i, frames[i]));
                    }

                    document.SendCommand(cmd);
                }
            }
        }