private void pnlSelectedColor_BackColorChanged(object sender, System.EventArgs e)
        {
            ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
            rgs.Color = pnlSelectedColor.BackColor;

            if (ColorChanged != null)
            {
                ColorChanged(pnlSelectedColor.BackColor, rgs);
            }
        }
Exemplo n.º 2
0
        protected override void OnMouseUp(MouseEventArgs p)
        {
            base.OnMouseUp(p);

            if (ColorPick != null && this.BackgroundImage != null)
            {
                ColorUIEditorPaletteCtrl.ColorPickEventArgs args = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();

                if (p.X < this.BackgroundImage.Width && p.Y < this.BackgroundImage.Height && p.X > 1 && p.Y > 1)
                {
                    args.Color = ((Bitmap)this.BackgroundImage).GetPixel(p.X, p.Y);

                    ColorPick(this, args);
                }
            }
        }
Exemplo n.º 3
0
        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseDown(e);

            m_MouseDown = true;

            if (ColorPick != null)
            {
                ColorUIEditorPaletteCtrl.ColorPickEventArgs args = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();

                args.Color = ColorManager.SetBrightness(m_BaseColor, 1.0 - (double)e.Y * m_Factor / 2.0);

                ColorPick(this, args);
            }

            this.Invalidate();
        }
        private void myColorWheel_ColorChanged(object sender, ColorChangedEventArgs e)
        {
            SetRGB(e.RGB);
            SetHSV(e.HSV);

            if (isInUpdate == true)
            {
                return;
            }

            isInUpdate = true;

            ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
            rgs.Color = Color.FromArgb(e.RGB.Red, e.RGB.Green, e.RGB.Blue);

            if (ColorChanged != null)
            {
                ColorChanged(Color.FromArgb(e.RGB.Red, e.RGB.Green, e.RGB.Blue), rgs);
            }

            isInUpdate = false;
        }
        private void HandleRGBChange(object sender, System.EventArgs e)
        {
            // If the R, G, or B values change, use this
            // code to update the HSV values and invalidate
            // the color wheel (so it updates the pointers).
            // Check the isInUpdate flag to avoid recursive events
            // when you update the NumericUpdownControls.
            if (!isInUpdate)
            {
                changeType = ChangeStyle.RGB;
                RGB        = new ColorManagerWheel.RGB((int)nudRed.Value, (int)nudGreen.Value, (int)nudBlue.Value);
                SetHSV(ColorManagerWheel.RGBtoHSV(RGB));
                this.Invalidate();

                ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
                rgs.Color = Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue);

                if (ColorChanged != null)
                {
                    ColorChanged(Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue), rgs);
                }
            }
        }
        private void HandleHSVChange(object sender, EventArgs e)
        {
            // If the H, S, or V values change, use this
            // code to update the RGB values and invalidate
            // the color wheel (so it updates the pointers).
            // Check the isInUpdate flag to avoid recursive events
            // when you update the NumericUpdownControls.
            if (!isInUpdate)
            {
                changeType = ChangeStyle.HSV;
                HSV        = new ColorManagerWheel.HSV((int)(nudHue.Value), (int)(nudSaturation.Value), (int)(nudBrightness.Value));
                ColorManagerWheel.RGB rgb = ColorManagerWheel.HSVtoRGB(HSV);
                SetRGB(rgb);
                this.Invalidate();

                ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
                rgs.Color = Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue);

                if (ColorChanged != null)
                {
                    ColorChanged(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue), rgs);
                }
            }
        }
Exemplo n.º 7
0
		private void pnlSelectedColor_BackColorChanged(object sender, System.EventArgs e)
		{
			ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
			rgs.Color = pnlSelectedColor.BackColor;

			if (ColorChanged != null)
				ColorChanged(pnlSelectedColor.BackColor, rgs);
		}
Exemplo n.º 8
0
		private void myColorWheel_ColorChanged(object sender, ColorChangedEventArgs e)
		{
			SetRGB(e.RGB);
			SetHSV(e.HSV);

			if (isInUpdate == true)
				return;

			isInUpdate = true;

			ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
			rgs.Color = Color.FromArgb(e.RGB.Red, e.RGB.Green, e.RGB.Blue);

			if (ColorChanged != null)
				ColorChanged(Color.FromArgb(e.RGB.Red, e.RGB.Green, e.RGB.Blue), rgs);

			isInUpdate = false;
		}
Exemplo n.º 9
0
		private void HandleHSVChange(object sender, EventArgs e)
		{
			// If the H, S, or V values change, use this 
			// code to update the RGB values and invalidate
			// the color wheel (so it updates the pointers).
			// Check the isInUpdate flag to avoid recursive events
			// when you update the NumericUpdownControls.
			if (! isInUpdate)
			{
				changeType = ChangeStyle.HSV;
				HSV = new ColorManagerWheel.HSV((int) (nudHue.Value), (int) (nudSaturation.Value), (int) (nudBrightness.Value));
				ColorManagerWheel.RGB rgb = ColorManagerWheel.HSVtoRGB(HSV);
				SetRGB(rgb);
				this.Invalidate();

				ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
				rgs.Color = Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue);

				if (ColorChanged != null)
					ColorChanged(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue), rgs);
			}
		}
Exemplo n.º 10
0
		private void HandleRGBChange(object sender, System.EventArgs e)
		{
			// If the R, G, or B values change, use this 
			// code to update the HSV values and invalidate
			// the color wheel (so it updates the pointers).
			// Check the isInUpdate flag to avoid recursive events
			// when you update the NumericUpdownControls.
			if (!isInUpdate)
			{
				changeType = ChangeStyle.RGB;
				RGB = new ColorManagerWheel.RGB((int) nudRed.Value, (int) nudGreen.Value, (int) nudBlue.Value);
				SetHSV(ColorManagerWheel.RGBtoHSV(RGB));
				this.Invalidate();

				ColorUIEditorPaletteCtrl.ColorPickEventArgs rgs = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
				rgs.Color = Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue);

				if (ColorChanged != null)
					ColorChanged(Color.FromArgb(RGB.Red, RGB.Green, RGB.Blue), rgs);
			}
		}
Exemplo n.º 11
0
		protected override void OnMouseUp(MouseEventArgs p)
		{
			base.OnMouseUp (p);

			if (ColorPick != null && this.BackgroundImage != null)
			{
				ColorUIEditorPaletteCtrl.ColorPickEventArgs args = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
				
				if (p.X < this.BackgroundImage.Width && p.Y < this.BackgroundImage.Height && p.X > 1 && p.Y > 1)
				{
					args.Color = ((Bitmap)this.BackgroundImage).GetPixel(p.X, p.Y);

					ColorPick(this, args);
				}
			}
		}
		protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
		{
			base.OnMouseMove(e);

			if (m_MouseDown == false)
				return;

			if (ColorPick != null)
			{
				ColorUIEditorPaletteCtrl.ColorPickEventArgs args = new ColorUIEditorPaletteCtrl.ColorPickEventArgs();
				
				args.Color = ColorManager.SetBrightness(m_BaseColor, 1.0 - (double)e.Y * m_Factor / 2.0);

				ColorPick(this, args);
			}	
					
			this.Invalidate();
		}