AdjustGainDialog.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using PaintDotNet.Base.SettingModel;
  11. namespace PaintDotNet.ImageCollect
  12. {
  13. internal class AdjustGainDialog : FloatingToolForm
  14. {
  15. #region
  16. /// <summary>
  17. /// Required designer variable.
  18. /// </summary>
  19. private System.ComponentModel.IContainer components = null;
  20. /// <summary>
  21. /// Clean up any resources being used.
  22. /// </summary>
  23. /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  24. protected override void Dispose(bool disposing)
  25. {
  26. if (disposing && (components != null))
  27. {
  28. components.Dispose();
  29. }
  30. base.Dispose(disposing);
  31. }
  32. #region Windows Form Designer generated code
  33. /// <summary>
  34. /// Required method for Designer support - do not modify
  35. /// the contents of this method with the code editor.
  36. /// </summary>
  37. private void InitializeComponent()
  38. {
  39. this.components = new System.ComponentModel.Container();
  40. this.timer1 = new System.Windows.Forms.Timer(this.components);
  41. this.SuspendLayout();
  42. //
  43. // timer1
  44. //
  45. this.timer1.Enabled = true;
  46. this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
  47. //
  48. // AdjustGainDialog
  49. //
  50. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  51. this.ClientSize = new System.Drawing.Size(144, 17);
  52. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  53. this.Name = "AdjustGainDialog";
  54. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  55. this.Activated += new System.EventHandler(this.AdjustExposureDialog_Activated);
  56. this.Load += new System.EventHandler(this.Dialog_Load);
  57. this.ResumeLayout(false);
  58. }
  59. #endregion
  60. #endregion
  61. private Timer timer1;
  62. private AdjustExposureControl m_control;
  63. public AdjustGainDialog()
  64. {
  65. InitializeComponent();
  66. m_control = new AdjustExposureControl(2);
  67. m_control.Location = new Point(4, 4);
  68. this.Controls.Add(m_control);
  69. }
  70. private void Dialog_Load(object sender, EventArgs e)
  71. {
  72. this.Text = PdnResources.GetString("Menu.timeofexposure.text");
  73. this.Height = m_control.Height + 42;
  74. this.Width = m_control.Width + 26;
  75. }
  76. private void AdjustExposureDialog_Activated(object sender, EventArgs e)
  77. {
  78. m_control.Initialize(Startup.instance.cameraParamModel);
  79. }
  80. private void timer1_Tick(object sender, EventArgs e)
  81. {
  82. m_control.Enabled = Camera.CameraManager.IsLive;
  83. }
  84. }
  85. }