public ScreenShoot(SettingsModel sm) { this.sm = sm; pa = new PiAction(); pi = pa.GetPi(sm.RecordLocation); imageName = pi.LastImageID; }
private void button_Click_2(object sender, RoutedEventArgs e) { // restore project info json file string address = p_pi.ProjectLocation; string searchPattern = "_*.png"; DirectoryInfo di = new DirectoryInfo(address); FileInfo[] files = di.GetFiles(searchPattern); ProjectInfo pinfo = new PiAction().GetPi(address); pinfo.Images = new List <Images>(); foreach (var file in files) { pinfo.Images.Add(new Images { Date = file.CreationTime, imageId = int.Parse(file.Name.Substring(1, file.Name.Length - 5)), ImageName = file.Name }); } PiAction pa = new PiAction(); pa.writePi(address, pinfo); }
private void openProject_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); DialogResult result = fbd.ShowDialog(); if (fbd.SelectedPath != "") { PiAction pa = new PiAction(); this.pi = pa.GetPi(fbd.SelectedPath); if (pi == null) { return; } this.sm = this.pi.SettingsModel; UpdateFields(this.pi); } }
private void open_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); DialogResult result = fbd.ShowDialog(); if (fbd.SelectedPath != null && Directory.Exists(fbd.SelectedPath)) { p_pa = new PiAction(); p_pi = p_pa.GetPi(fbd.SelectedPath); imgCount = p_pi.Images.Count; if (imgCount > 0) { slider.Maximum = imgCount; loadImage(p_pi.Images[0].ImageName); slider.IsEnabled = true; } } else { System.Windows.Forms.MessageBox.Show("Geçerli Bir Proje Dizini Seçiniz"); return; } }
private void startRecordingBtn_Click(object sender, RoutedEventArgs e) { if (!Directory.Exists(folderLocation.Text)) { System.Windows.Forms.MessageBox.Show("Geçerli bir dizin seçiniz"); return; } sm.FPM = int.Parse(fpm.Text); sm.RecordLocation = folderLocation.Text; sm.ProgramStat = ProgramStatus.Active; sm.WxH = new System.Drawing.Size(int.Parse(www.Text), int.Parse(hhh.Text)); pi.ProjectName = projectName.Text; pi.ProjectLocation = sm.RecordLocation; pi.SettingsModel = sm; if (pi.Images == null) { pi.Images = new List <Images>(); } this.Hide(); // Keyboard listeners ... _listener = new LowLevelKeyboardListener(); _listener.OnKeyPressed += _listener_OnKeyPressed; _listener.HookKeyboard(); drawProgramStatus(); PiAction piAction = new PiAction(pi); this.pi.LastImageID = piAction.GetPi(pi.ProjectLocation).LastImageID; piAction.writePi(folderLocation.Text, pi); this.pi = piAction.GetPi(pi.ProjectLocation); this.sm = this.pi.SettingsModel; UpdateFields(pi); startRecording(); }