Example #1
0
        /// <summary>
        /// Handles the ComponentValueChanged event that the ColorSpace raises 
        /// when the value of one of its components is changed by way of a
        /// keyboard user input. The color spaces are synced up and the color
        /// panels updated.
        /// </summary>
        /// <param name="sender">The ColorSpace object that raised the event.</param>
        /// <param name="e">An EventArgs object containing the event data.</param>
        private void ColorSpaceComponentValueChanged( ColorSpace sender, EventArgs e )
        {
            if ( sender is RgbColorSpace ) {
                hsbColorSpace.Structure = ColorConverter.RgbToHsb( ( RGB ) rgbColorSpace.Structure );
            } else if ( sender is HsbColorSpace ) {
                rgbColorSpace.Structure = ColorConverter.HsbToRgb( ( HSB ) hsbColorSpace.Structure ); //, ( 255 - ( this.m_currentColorSliderArrowYLocation - m_colorSliderInnerRegion.Top ) ) );
            }

            UpdateColorSliderArrowRegions();
            UpdateColorPanels( true, true, true );
        }
Example #2
0
        /// <summary>
        /// Handles the SelectedColorSpaceComponentChanged event raised by the
        /// color spaces. When this occurs, the color slider arrow regions and 
        /// the color panels are updated.
        /// </summary>
        /// <param name="sender">The ColorSpace object that raised the event.</param>
        /// <param name="e">An EventArgs containing the event data.</param>
        private void SelectedColorSpaceComponentChanged( ColorSpace sender, EventArgs e )
        {
            if ( sender is RgbColorSpace ) {
                hsbColorSpace.ResetComponents();
            } else if ( sender is HsbColorSpace ) {
                rgbColorSpace.ResetComponents();
            }

            m_currentColorSpace = sender;

            UpdateColorSliderArrowRegions();
            UpdateColorPanels( true, true, true );
        }
Example #3
0
 public void UpdateColor(ColorSpace colorSpace, char component, int selectedComponentValue, bool resetPreviouslyPickedPoint)
 {
     m_color = Color.Empty;
     m_selectedComponentValue = selectedComponentValue;
     UpdateColor(colorSpace, component, resetPreviouslyPickedPoint);
 }
Example #4
0
 public void UpdateColor(ColorSpace colorSpace, char component, Color color, bool resetPreviouslyPickedPoint)
 {
     m_color = color;
     UpdateColor(colorSpace, component, resetPreviouslyPickedPoint);
 }
Example #5
0
 public void UpdateColor( ColorSpace colorSpace, char component, int selectedComponentValue, bool resetPreviouslyPickedPoint )
 {
     m_color = Color.Empty;
     m_selectedComponentValue = selectedComponentValue;
     UpdateColor( colorSpace, component, resetPreviouslyPickedPoint );
 }
Example #6
0
 public void UpdateColor( ColorSpace colorSpace, char component, Color color, bool resetPreviouslyPickedPoint )
 {
     m_color = color;
     UpdateColor( colorSpace, component, resetPreviouslyPickedPoint );
 }
Example #7
0
        private void UpdateColor( ColorSpace colorSpace, char component, bool resetPreviouslyPickedPoint )
        {
            m_colorSpace = colorSpace;
            m_component = component;

            m_mousePressedWithinPanel = resetPreviouslyPickedPoint;
            this.UpdateCurrentColorBitmap( resetPreviouslyPickedPoint );
            this.Invalidate();
        }