Esempio n. 1
0
        private void StartStopCaptureCommand_Execute()
        {
            this.Capturing = !this.Capturing;
            if (!this.Capturing)
            {
                if (this.CaptureFrames.Count() == 0)
                {
                    new MessageBoxViewModel("No frames captured, export cancelled!", "Capture Error").Show(this.Dialogs);
                    return;
                }
                BreakAllCommand_Execute();

                var dlg = new SaveFileDialogViewModel
                {
                    Title    = "Save Capture",
                    Filter   = "GIF files (*.gif)|*.hex|All files (*.*)|*.*",
                    FileName = "*.gif",
                };

                if (dlg.Show(this.Dialogs) == DialogResult.OK)
                {
                    this.Exporting = true;
                    var exportDlg = new CaptureExportViewModel(dlg.FileName, this.CaptureFrames, this.Simulation.Lcd.LcdAngle);
                    this.Dialogs.Add(exportDlg);
                    if (exportDlg.Success)
                    {
                        new MessageBoxViewModel("Export finished!").Show(this.Dialogs);
                    }
                    this.Exporting = false;
                }

                this.CaptureFrames.Clear();
            }
        }
Esempio n. 2
0
        private void ExportImageCommand_Execute()
        {
            var dlg = new SaveFileDialogViewModel
            {
                Title    = "Save Capture",
                Filter   = "GIF files (*.gif)|*.gif|All files (*.*)|*.*",
                FileName = "*.gif",
            };

            if (dlg.Show(this.Dialogs) == DialogResult.OK)
            {
                BreakAllCommand_Execute();
                var frames = new List <CaptureFrame> {
                    new CaptureFrame
                    {
                        Backlight = this.Simulation.Lcd.LcdCurrentBacklight,
                        Pixels    = (byte [])this.Simulation.Lcd.Pixels.Clone()
                    }
                };
                var exportDlg = new CaptureExportViewModel(dlg.FileName, frames, this.Simulation.Lcd.LcdAngle);
                this.Dialogs.Add(exportDlg);
            }
        }