AdjustSaturationDialog.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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;
  11. using PaintDotNet.Base.SettingModel;
  12. namespace PaintDotNet.ImageCollect
  13. {
  14. internal class AdjustSaturationDialog : 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. // AdjustSaturationDialog
  50. //
  51. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  52. this.ClientSize = new System.Drawing.Size(766, 265);
  53. this.Margin = new System.Windows.Forms.Padding(36, 19, 36, 19);
  54. this.Name = "AdjustSaturationDialog";
  55. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  56. this.Load += new System.EventHandler(this.AdjustSaturationDialog_Load);
  57. this.ResumeLayout(false);
  58. }
  59. #endregion
  60. #endregion
  61. private CameraParamModel m_cameraParamModel = Startup.instance.cameraParamModel;
  62. private Timer timer1;
  63. private AdjustSaturationControl m_control;
  64. public AdjustSaturationDialog()
  65. {
  66. InitializeComponent();
  67. this.Text = PdnResources.GetString("Menu.saturation.text");
  68. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  69. this.MaximizeBox = false;
  70. this.MinimizeBox = false;
  71. }
  72. private void AdjustSaturationDialog_Load(object sender, EventArgs e)
  73. {
  74. m_control = new AdjustSaturationControl();
  75. m_control.Location = new Point(5, 5);
  76. this.Controls.Add(m_control);
  77. this.Width = m_control.Width + 30;
  78. this.Height = m_control.Height + 50;
  79. m_control.Initialize(m_cameraParamModel, true);
  80. }
  81. private void timer1_Tick(object sender, EventArgs e)
  82. {
  83. m_control.Enabled = Camera.CameraManager.IsLive;
  84. }
  85. }
  86. }