//CMY private void trackBarYellow_Scroll(object sender, EventArgs e) { //CMY textBoxYellow.Text = TransformationCMY.reSizeCMY(trackBarYellow.Value); //RGB trackBarBlue.Value = Convert.ToInt32(TransformationCMY.getRGBbyCMY(textBoxYellow.Text)); panel1.BackColor = System.Drawing.Color.FromArgb (trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value); textBoxBlue.Text = trackBarBlue.Value.ToString(); //HLS setHLS(); }
// For RGB private void trackBarBlue_Scroll(object sender, EventArgs e) { //RGB panel1.BackColor = System.Drawing.Color.FromArgb (trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value); textBoxBlue.Text = trackBarBlue.Value.ToString(); //CMY textBoxYellow.Text = TransformationCMY.getCMYbyRGB(textBoxBlue.Text); trackBarYellow.Value = TransformationCMY.reSizeCMY(textBoxYellow.Text); //HLS setHLS(); //Lu'v' setLUV(); }
// For CMY private void setCMYFromRGB() { TransformationHLStoRGB trans = new TransformationHLStoRGB(textBoxHue.Text, textBoxLightness.Text, textBoxSaturation.Text); trackBarCyan.Scroll -= trackBarCyan_Scroll; trackBarMagenta.Scroll -= trackBarMagenta_Scroll; trackBarYellow.Scroll -= trackBarYellow_Scroll; textBoxCyan.Text = TransformationCMY.getCMYbyRGB(textBoxRed.Text); textBoxMagenta.Text = TransformationCMY.getCMYbyRGB(textBoxGreen.Text); textBoxYellow.Text = TransformationCMY.getCMYbyRGB(textBoxBlue.Text); trackBarCyan.Value = TransformationCMY.reSizeCMY(textBoxCyan.Text); trackBarMagenta.Value = TransformationCMY.reSizeCMY(textBoxMagenta.Text); trackBarYellow.Value = TransformationCMY.reSizeCMY(textBoxYellow.Text); trackBarCyan.Scroll += trackBarCyan_Scroll; trackBarMagenta.Scroll += trackBarMagenta_Scroll; trackBarYellow.Scroll += trackBarYellow_Scroll; }
// For RGB private void textBoxBlue_TextChanged(object sender, EventArgs e) { String count = getSimpleStringRGB(textBoxBlue.Text); int value = 0; if (count.Length != 0) { value = Convert.ToInt32(count); } textBoxBlue.Text = count; trackBarBlue.Value = value; panel1.BackColor = System.Drawing.Color.FromArgb (trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value); //CMY textBoxYellow.Text = TransformationCMY.getCMYbyRGB(textBoxBlue.Text); trackBarYellow.Value = TransformationCMY.reSizeCMY(textBoxYellow.Text); //HLS setHLS(); //Lu'v' setLUV(); }