AdjustExposureDialog.cs 3.3 KB

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