Beispiel #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.m_csRed   = new ColorSpaceComponent();
            this.m_csBlue  = new ColorSpaceComponent();
            this.m_csGreen = new ColorSpaceComponent();
            this.SuspendLayout();
            //
            // m_csRed
            //
            this.m_csRed.DisplayCharacter    = 'R';
            this.m_csRed.Location            = new System.Drawing.Point(8, 8);
            this.m_csRed.Name                = "m_csRed";
            this.m_csRed.Selected            = false;
            this.m_csRed.Size                = new System.Drawing.Size(96, 32);
            this.m_csRed.TabIndex            = 0;
            this.m_csRed.Unit                = ComponentUnit.Value;
            this.m_csRed.Value               = 0;
            this.m_csRed.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(ComponentTextKeyUp);
            this.m_csRed.ComponentSelected  += new ColorSpaceComponentEventHandler(this.ComponentSelected);
            //			this.m_csRed.ComponentTextLostFocus += new ColorSpaceComponent.ComponentTextLostFocusHandler(this.ComponentTextLostFocus);
            //
            // m_csBlue
            //
            this.m_csBlue.DisplayCharacter    = 'B';
            this.m_csBlue.Location            = new System.Drawing.Point(8, 56);
            this.m_csBlue.Name                = "m_csBlue";
            this.m_csBlue.Selected            = false;
            this.m_csBlue.Size                = new System.Drawing.Size(96, 32);
            this.m_csBlue.TabIndex            = 2;
            this.m_csBlue.Unit                = ComponentUnit.Value;
            this.m_csBlue.Value               = 0;
            this.m_csBlue.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(ComponentTextKeyUp);
            this.m_csBlue.ComponentSelected  += new ColorSpaceComponentEventHandler(this.ComponentSelected);
            //			this.m_csBlue.ComponentTextLostFocus += new ColorSpaceComponent.ComponentTextLostFocusHandler(this.ComponentTextLostFocus);
            //
            // m_csGreen
            //
            this.m_csGreen.DisplayCharacter = 'G';
            this.m_csGreen.Location         = new System.Drawing.Point(8, 32);
            this.m_csGreen.Name             = "m_csGreen";
            this.m_csGreen.Selected         = false;
            this.m_csGreen.Size             = new System.Drawing.Size(96, 32);
            this.m_csGreen.TabIndex         = 1;
            this.m_csGreen.Unit             = ComponentUnit.Value;
            this.m_csGreen.Value            = 0;

            this.m_csGreen.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(ComponentTextKeyUp);
            this.m_csGreen.ComponentSelected  += new ColorSpaceComponentEventHandler(this.ComponentSelected);
            //			this.m_csGreen.ComponentTextLostFocus += new ColorSpaceComponent.ComponentTextLostFocusHandler(this.ComponentTextLostFocus);
            //
            // RgbColorSpace
            //
            this.Controls.Add(this.m_csBlue);
            this.Controls.Add(this.m_csGreen);
            this.Controls.Add(this.m_csRed);
            this.Name = "RgbColorSpace";
            this.Size = new System.Drawing.Size(112, 96);
            this.ResumeLayout(false);
        }
Beispiel #2
0
        /// <summary>
        /// Changes the currently selected color space component.
        /// </summary>
        /// <param name="component">A ColorSpaceComponent representing the
        /// component that is to be set as the selected component.</param>

        protected void ChangeCurrentlySelectedComponent(ColorSpaceComponent component)
        {
            // make sure none of the ColorSpaceComponents are checked.
            ResetComponents();

            component.Selected  = true;
            m_selectedComponent = component;

            OnSelectedComponentChanged(EventArgs.Empty);
        }
Beispiel #3
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.m_csBrightness = new ColorSpaceComponent();
     this.m_csSaturation = new ColorSpaceComponent();
     this.m_csHue        = new ColorSpaceComponent();
     this.SuspendLayout();
     //
     // m_csBrightness
     //
     this.m_csBrightness.DisplayCharacter    = 'B';
     this.m_csBrightness.Location            = new System.Drawing.Point(8, 56);
     this.m_csBrightness.Name                = "m_csBrightness";
     this.m_csBrightness.Size                = new System.Drawing.Size(96, 32);
     this.m_csBrightness.TabIndex            = 2;
     this.m_csBrightness.Unit                = ComponentUnit.Percentage;
     this.m_csBrightness.Value               = 0;
     this.m_csBrightness.MaximumValue        = 100;
     this.m_csBrightness.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(this.ComponentTextKeyUp);
     this.m_csBrightness.ComponentSelected  += new ColorSpaceComponentEventHandler(ComponentSelected);
     //
     // m_csSaturation
     //
     this.m_csSaturation.DisplayCharacter    = 'S';
     this.m_csSaturation.Location            = new System.Drawing.Point(8, 32);
     this.m_csSaturation.Name                = "m_csSaturation";
     this.m_csSaturation.Size                = new System.Drawing.Size(96, 32);
     this.m_csSaturation.TabIndex            = 1;
     this.m_csSaturation.Unit                = ComponentUnit.Percentage;
     this.m_csSaturation.Value               = 0;
     this.m_csSaturation.MaximumValue        = 100;
     this.m_csSaturation.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(this.ComponentTextKeyUp);
     this.m_csSaturation.ComponentSelected  += new ColorSpaceComponentEventHandler(ComponentSelected);
     //
     // m_csHue
     //
     this.m_csHue.DisplayCharacter    = 'H';
     this.m_csHue.Location            = new System.Drawing.Point(8, 8);
     this.m_csHue.Name                = "m_csHue";
     this.m_csHue.Size                = new System.Drawing.Size(96, 32);
     this.m_csHue.TabIndex            = 0;
     this.m_csHue.Unit                = ComponentUnit.Degree;
     this.m_csHue.Value               = 0;
     this.m_csHue.MaximumValue        = 360;
     this.m_csHue.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(this.ComponentTextKeyUp);
     this.m_csHue.ComponentSelected  += new ColorSpaceComponentEventHandler(ComponentSelected);
     //
     // HsbColorSpace
     //
     this.Controls.Add(this.m_csBrightness);
     this.Controls.Add(this.m_csSaturation);
     this.Controls.Add(this.m_csHue);
     this.Name = "HsbColorSpace";
     this.Size = new System.Drawing.Size(112, 96);
     this.ResumeLayout(false);
 }
Beispiel #4
0
        private void CalculateValueRegionMapping(ColorSpaceComponent csc)
        {
            int mValue = csc.Value;

            switch (csc.Unit)
            {
            case ComponentUnit.Percentage:
                mValue = ( int )Math.Ceiling(((( double )255) / 100) * mValue);
                break;

            case ComponentUnit.Degree:
                mValue = ( int )Math.Ceiling(((( double )255) / 360) * mValue);
                break;
            }

            SetCurrentSliderArrowYLocation(mValue);
        }
Beispiel #5
0
 /// <summary>
 /// Handles the ComponentTextKeyUp event that the ColorSpaceComponent
 /// raises.
 /// </summary>
 /// <param name="sender">The ColorSpaceComponent that raised the event.</param>
 /// <param name="e">An EventArgs containing the event data.</param>
 protected void ComponentTextKeyUp( ColorSpaceComponent sender, EventArgs e )
 {
     OnComponentValueChanged( e );
 }
Beispiel #6
0
 /// <summary>
 /// Handles the ComponentSelected event that the ColorSpaceComponent
 /// raises.
 /// </summary>
 /// <param name="sender">The ColorSpaceComponent that raised the event.</param>
 /// <param name="e">An EventArgs containing the event data.</param>
 protected void ComponentSelected( ColorSpaceComponent sender, EventArgs e )
 {
     ChangeCurrentlySelectedComponent( sender );
 }
Beispiel #7
0
        /// <summary>
        /// Changes the currently selected color space component.
        /// </summary>
        /// <param name="component">A ColorSpaceComponent representing the 
        /// component that is to be set as the selected component.</param>
        protected void ChangeCurrentlySelectedComponent( ColorSpaceComponent component )
        {
            // make sure none of the ColorSpaceComponents are checked.
            ResetComponents();

            component.Selected = true;
            m_selectedComponent = component;

            OnSelectedComponentChanged( EventArgs.Empty );
        }
Beispiel #8
0
        private void CalculateValueRegionMapping( ColorSpaceComponent csc )
        {
            int mValue = csc.Value;

            switch ( csc.Unit ) {

                case ComponentUnit.Percentage:
                    mValue = ( int ) Math.Ceiling( ( ( ( double ) 255 ) / 100 ) * mValue );
                    break;

                case ComponentUnit.Degree:
                    mValue = ( int ) Math.Ceiling( ( ( ( double ) 255 ) / 360 ) * mValue );
                    break;

            }

            SetCurrentSliderArrowYLocation( mValue );
        }
Beispiel #9
0
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.m_csRed = new ColorSpaceComponent();
            this.m_csBlue = new ColorSpaceComponent();
            this.m_csGreen = new ColorSpaceComponent();
            this.SuspendLayout();
            //
            // m_csRed
            //
            this.m_csRed.DisplayCharacter = 'R';
            this.m_csRed.Location = new System.Drawing.Point(8, 8);
            this.m_csRed.Name = "m_csRed";
            this.m_csRed.Selected = false;
            this.m_csRed.Size = new System.Drawing.Size(96, 32);
            this.m_csRed.TabIndex = 0;
            this.m_csRed.Unit = ComponentUnit.Value;
            this.m_csRed.Value = 0;
            this.m_csRed.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(ComponentTextKeyUp);
            this.m_csRed.ComponentSelected += new ColorSpaceComponentEventHandler(this.ComponentSelected);
            //			this.m_csRed.ComponentTextLostFocus += new ColorSpaceComponent.ComponentTextLostFocusHandler(this.ComponentTextLostFocus);
            //
            // m_csBlue
            //
            this.m_csBlue.DisplayCharacter = 'B';
            this.m_csBlue.Location = new System.Drawing.Point(8, 56);
            this.m_csBlue.Name = "m_csBlue";
            this.m_csBlue.Selected = false;
            this.m_csBlue.Size = new System.Drawing.Size(96, 32);
            this.m_csBlue.TabIndex = 2;
            this.m_csBlue.Unit = ComponentUnit.Value;
            this.m_csBlue.Value = 0;
            this.m_csBlue.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(ComponentTextKeyUp);
            this.m_csBlue.ComponentSelected += new ColorSpaceComponentEventHandler(this.ComponentSelected);
            //			this.m_csBlue.ComponentTextLostFocus += new ColorSpaceComponent.ComponentTextLostFocusHandler(this.ComponentTextLostFocus);
            //
            // m_csGreen
            //
            this.m_csGreen.DisplayCharacter = 'G';
            this.m_csGreen.Location = new System.Drawing.Point(8, 32);
            this.m_csGreen.Name = "m_csGreen";
            this.m_csGreen.Selected = false;
            this.m_csGreen.Size = new System.Drawing.Size(96, 32);
            this.m_csGreen.TabIndex = 1;
            this.m_csGreen.Unit = ComponentUnit.Value;
            this.m_csGreen.Value = 0;

            this.m_csGreen.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(ComponentTextKeyUp);
            this.m_csGreen.ComponentSelected += new ColorSpaceComponentEventHandler(this.ComponentSelected);
            //			this.m_csGreen.ComponentTextLostFocus += new ColorSpaceComponent.ComponentTextLostFocusHandler(this.ComponentTextLostFocus);
            //
            // RgbColorSpace
            //
            this.Controls.Add(this.m_csBlue);
            this.Controls.Add(this.m_csGreen);
            this.Controls.Add(this.m_csRed);
            this.Name = "RgbColorSpace";
            this.Size = new System.Drawing.Size(112, 96);
            this.ResumeLayout(false);
        }
Beispiel #10
0
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.m_csBrightness = new ColorSpaceComponent();
     this.m_csSaturation = new ColorSpaceComponent();
     this.m_csHue = new ColorSpaceComponent();
     this.SuspendLayout();
     //
     // m_csBrightness
     //
     this.m_csBrightness.DisplayCharacter = 'B';
     this.m_csBrightness.Location = new System.Drawing.Point(8, 56);
     this.m_csBrightness.Name = "m_csBrightness";
     this.m_csBrightness.Size = new System.Drawing.Size(96, 32);
     this.m_csBrightness.TabIndex = 2;
     this.m_csBrightness.Unit = ComponentUnit.Percentage;
     this.m_csBrightness.Value = 0;
     this.m_csBrightness.MaximumValue = 100;
     this.m_csBrightness.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(this.ComponentTextKeyUp);
     this.m_csBrightness.ComponentSelected += new ColorSpaceComponentEventHandler(ComponentSelected);
     //
     // m_csSaturation
     //
     this.m_csSaturation.DisplayCharacter = 'S';
     this.m_csSaturation.Location = new System.Drawing.Point(8, 32);
     this.m_csSaturation.Name = "m_csSaturation";
     this.m_csSaturation.Size = new System.Drawing.Size(96, 32);
     this.m_csSaturation.TabIndex = 1;
     this.m_csSaturation.Unit = ComponentUnit.Percentage;
     this.m_csSaturation.Value = 0;
     this.m_csSaturation.MaximumValue = 100;
     this.m_csSaturation.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(this.ComponentTextKeyUp);
     this.m_csSaturation.ComponentSelected += new ColorSpaceComponentEventHandler(ComponentSelected);
     //
     // m_csHue
     //
     this.m_csHue.DisplayCharacter = 'H';
     this.m_csHue.Location = new System.Drawing.Point(8, 8);
     this.m_csHue.Name = "m_csHue";
     this.m_csHue.Size = new System.Drawing.Size(96, 32);
     this.m_csHue.TabIndex = 0;
     this.m_csHue.Unit = ComponentUnit.Degree;
     this.m_csHue.Value = 0;
     this.m_csHue.MaximumValue = 360;
     this.m_csHue.ComponentTextKeyUp += new ColorSpaceComponentEventHandler(this.ComponentTextKeyUp);
     this.m_csHue.ComponentSelected += new ColorSpaceComponentEventHandler(ComponentSelected);
     //
     // HsbColorSpace
     //
     this.Controls.Add(this.m_csBrightness);
     this.Controls.Add(this.m_csSaturation);
     this.Controls.Add(this.m_csHue);
     this.Name = "HsbColorSpace";
     this.Size = new System.Drawing.Size(112, 96);
     this.ResumeLayout(false);
 }
Beispiel #11
0
        /// <summary>
        /// Handles the ComponentSelected event that the ColorSpaceComponent
        /// raises.
        /// </summary>
        /// <param name="sender">The ColorSpaceComponent that raised the event.</param>
        /// <param name="e">An EventArgs containing the event data.</param>

        protected void ComponentSelected(ColorSpaceComponent sender, EventArgs e)
        {
            ChangeCurrentlySelectedComponent(sender);
        }
Beispiel #12
0
        /// <summary>
        /// Handles the ComponentTextKeyUp event that the ColorSpaceComponent
        /// raises.
        /// </summary>
        /// <param name="sender">The ColorSpaceComponent that raised the event.</param>
        /// <param name="e">An EventArgs containing the event data.</param>

        protected void ComponentTextKeyUp(ColorSpaceComponent sender, EventArgs e)
        {
            OnComponentValueChanged(e);
        }