public SetBackgroundImage ( string fileName ) : void | ||
fileName | string | |
return | void |
void Main_Load(object sender, EventArgs e) { Left = Screen.PrimaryScreen.WorkingArea.Width / 24; Top = Screen.PrimaryScreen.WorkingArea.Height / 16; pluginAssemblyFileName.Text = Properties.Settings.Default.PluginAssemblyFileName; backgroundTestImageFileName.Text = Properties.Settings.Default.BackgroundTestImageFileName; sampleSessionDataFileName.Text = Properties.Settings.Default.SampleSessionDataFileName; domainForm = DomainForm.CreateRemote(pluginAssemblyFileName.Text); domainForm.SetSessionDataFileName(sampleSessionDataFileName.Text); domainForm.SetOnError((s, m) => errorDetailsTextBox.Text = s + "\r\n" + m); domainForm.SetOnAnimationTick((d, f) => { playbackTimeLabel.Text = String.Format("Time: {0} over {1}", f, d); double percentage = f / d; if (!moving) { replayProgress.SplitterDistance = (int)(percentage * replayProgress.Width); } }); if (File.Exists(backgroundTestImageFileName.Text)) { domainForm.SetBackgroundImage(backgroundTestImageFileName.Text); domainForm.SetClientSize(new Size(1920 / 3, 1080 / 3)); domainForm.SetPosition(this.Left, this.Top + this.Height); } domainForm.SetFramesPerSecond((int)framesPerSecond.Value); domainForm.Activate(); RecreateWatcher(); }
void browseBackgroundImageButton_Click(object sender, EventArgs e) { var fbd = new OpenFileDialog { Filter = "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*" }; if (backgroundTestImageFileName.Text != "") { fbd.FileName = Path.GetFileName(backgroundTestImageFileName.Text); fbd.InitialDirectory = Path.GetDirectoryName(backgroundTestImageFileName.Text); } if (fbd.ShowDialog() == DialogResult.OK) { backgroundTestImageFileName.Text = fbd.FileName; backgroundTestImageFileName_Leave(null, null); } domainForm.SetBackgroundImage(backgroundTestImageFileName.Text); }
void Main_Load(object sender, EventArgs e) { Left = Screen.PrimaryScreen.WorkingArea.Width / 24; Top = Screen.PrimaryScreen.WorkingArea.Height / 16; pluginAssemblyFileName.Text = Properties.Settings.Default.PluginAssemblyFileName; backgroundTestImageFileName.Text = Properties.Settings.Default.BackgroundTestImageFileName; sampleSessionDataFileName.Text = Properties.Settings.Default.SampleSessionDataFileName; domainForm = DomainForm.CreateRemote(pluginAssemblyFileName.Text); domainForm.SetSessionDataFileName(sampleSessionDataFileName.Text); domainForm.SetOnError((s, m) => errorDetailsTextBox.Text = s + "\r\n" + m); domainForm.SetOnAnimationTick((d, f) => { playbackTimeLabel.Text = String.Format("Time: {0} over {1}", f, d); double percentage = f / d; if (!moving) replayProgress.SplitterDistance = (int)(percentage * replayProgress.Width); }); if (File.Exists(backgroundTestImageFileName.Text)) { domainForm.SetBackgroundImage(backgroundTestImageFileName.Text); domainForm.SetClientSize(new Size(1920 / 3, 1080 / 3)); domainForm.SetPosition(this.Left, this.Top + this.Height); } domainForm.SetFramesPerSecond((int)framesPerSecond.Value); domainForm.Activate(); RecreateWatcher(); }