private void MenuExportImage_Click(object sender, EventArgs e) { if (animation.FrameCount > 0) { var dialog = new SaveFileDialog() { InitialDirectory = Application.StartupPath + @"\Animation", Filter = "PNG Files (*.png)|*.png", FilterIndex = 1 }; var result = dialog.ShowDialog(); if (result == DialogResult.OK) { var exportParameters = new ExportParameters { BackBufferHeight = PictureAnimation.Height, BackBufferWidth = PictureAnimation.Width, MaxFramePerLineX = 5, }; var export = new AnimationExport(exportParameters); export.ExportPng(dialog.FileName, animation); } } }
private void ButtonExport_Click(object sender, EventArgs e) { var dialog = new SaveFileDialog() { InitialDirectory = Application.StartupPath + @"\Animation", Filter = "Animation Files (*.anim)|*.anim", }; var result = dialog.ShowDialog(); if (result == DialogResult.OK) { var parameters = new ExportParameters { BackBufferWidth = backBufferSize.Width, BackBufferHeight = backBufferSize.Height, MaxFramePerLineX = 0 }; var export = new AnimationExport(parameters); export.ExportObject(dialog.FileName, animationID, animation); Close(); } }