AdjustGainDialog.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.ImageCollect.CameraComponent;
  11. using PaintDotNet.Base.SettingModel;
  12. namespace PaintDotNet.ImageCollect
  13. {
  14. internal class AdjustGainDialog : 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.SuspendLayout();
  41. //
  42. // AdjustGainDialog
  43. //
  44. this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
  45. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  46. this.ClientSize = new System.Drawing.Size(647, 133);
  47. this.MaximizeBox = false;
  48. this.MinimizeBox = false;
  49. this.Name = "AdjustGainDialog";
  50. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  51. this.Activated += new System.EventHandler(this.AdjustGainDialog_Activated);
  52. this.Load += new System.EventHandler(this.AdjustGainDialog_Load);
  53. this.ResumeLayout(false);
  54. }
  55. #endregion
  56. #endregion
  57. private CameraParamModel m_cameraParamModel = Startup.instance.cameraParamModel;
  58. private AdjustGainControl m_control;
  59. public AdjustGainDialog()
  60. {
  61. InitializeComponent();
  62. this.Text = PdnResources.GetString("Menu.imagecapture.adjust.Gain.text");
  63. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  64. this.MaximizeBox = false;
  65. this.MinimizeBox = false;
  66. }
  67. private void AdjustGainDialog_Load(object sender, EventArgs e)
  68. {
  69. m_control = new AdjustGainControl(m_cameraParamModel, true);
  70. m_control.Location = new Point(5, 5);
  71. this.Controls.Add(m_control);
  72. this.Width = m_control.Width + 30;
  73. this.Height = m_control.Height + 50;
  74. }
  75. private void AdjustGainDialog_Activated(object sender, EventArgs e)
  76. {
  77. m_cameraParamModel = Startup.instance.cameraParamModel;
  78. m_control.ReLoad(m_cameraParamModel, true);
  79. }
  80. }
  81. }