private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) { if (colorPlaneColorComponent.Name == "RGB_Red") { rR.IsChecked = true; } else if (colorPlaneColorComponent.Name == "RGB_Green") { rG.IsChecked = true; } else if (colorPlaneColorComponent.Name == "RGB_Blue") { rB.IsChecked = true; } else { rR.IsChecked = false; rG.IsChecked = false; rB.IsChecked = false; } if (ColorComponentChanged != null) { ColorComponentChanged(this, new EventArgs <NormalComponent>(colorPlaneColorComponent)); } }
private void OnColorChanged(Color color) { if (mColorChangeSource == EColorChangeSource.ColorPropertySet) { UpdateColorPlaneBitmap(NormalComponent.Value(color)); SelectionPoint = NormalComponent.PointFromColor(color); selectionTransform.X = SelectionPoint.X - (mSelectionPane.PixelWidth / 2.0); selectionTransform.Y = SelectionPoint.Y - (mSelectionPane.PixelHeight / 2.0); sNormal.Value = NormalComponent.Value(color); if (!NormalComponent.IsNormalIndependantOfColor) { NormalComponent.UpdateNormalBitmap(mNormalPane, color); } } if (SelectionRingMode == ESelectionRingMode.BlackOrWhite) { AdjustSelectionRing(color); } if (ColorChanged != null) { ColorChanged(this, new EventArgs <Color>(color)); } }
private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) { if (colorPlaneColorComponent.Name == "HSB_Hue") { rH.IsChecked = true; } else if (colorPlaneColorComponent.Name == "HSB_Saturation") { rS.IsChecked = true; } else if (colorPlaneColorComponent.Name == "HSB_Brightness") { rB.IsChecked = true; } else { rH.IsChecked = false; rS.IsChecked = false; rB.IsChecked = false; } if (ColorComponentChanged != null) { ColorComponentChanged(this, new EventArgs <NormalComponent>(colorPlaneColorComponent)); } }
private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) { if (ColorComponentChanged != null) { ColorComponentChanged(this, new EventArgs <NormalComponent>(colorPlaneColorComponent)); } }
public void ViewComponentBuilderWithConstructorWithViewComponentShouldNotBeNull() { var viewComponent = new NormalComponent(); var viewComponentBuilder = new MyViewComponent <NormalComponent>(viewComponent); Assert.NotNull(viewComponentBuilder); Assert.IsAssignableFrom <NormalComponent>(viewComponentBuilder.TestContext.Component); }
private void rB_Checked(object sender, RoutedEventArgs e) { NormalComponent = sBlue; if (ColorComponentChanged != null) { ColorComponentChanged(this, new EventArgs <NormalComponent>(sBlue)); } }
private void UpdateColorPlaneBitmap(int colorComponentValue) { if (lastColorComponentValue != colorComponentValue || lastComponentName != NormalComponent.Name) { NormalComponent.UpdateColorPlaneBitmap(mSelectionPane, colorComponentValue); lastColorComponentValue = colorComponentValue; lastComponentName = NormalComponent.Name; } }
public void ViewComponentWithProvidedInstanceShouldPopulateCorrectInstanceOfViewComponentType() { var instance = new NormalComponent(); MyViewComponent<NormalComponent> .Instance(instance) .ShouldPassForThe<NormalComponent>(viewComponent => { Assert.NotNull(viewComponent); Assert.IsAssignableFrom<NormalComponent>(viewComponent); }); }
private void sNormal_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { mColorChangeSource = EColorChangeSource.SliderMove; if (ProcessSliderEvents) { ProcessSliderEvents = false; Color = NormalComponent.ColorAtPoint(SelectionPoint, (int)e.NewValue); UpdateColorPlaneBitmap(NormalComponent.Value(Color)); ProcessSliderEvents = true; } mColorChangeSource = EColorChangeSource.ColorPropertySet; }
public void ViewComponentWithProvidedInstanceShouldPopulateCorrectInstanceOfViewComponentType() { var instance = new NormalComponent(); MyViewComponent <NormalComponent> .Instance(instance) .ShouldPassForThe <NormalComponent>(viewComponent => { Assert.NotNull(viewComponent); Assert.IsAssignableFrom <NormalComponent>(viewComponent); }); }
private void OnNormalComponentChanged(NormalComponent cc) { SelectionPoint = cc.PointFromColor(Color); selectionTransform.X = SelectionPoint.X - (colorPlane.ActualWidth / 2); selectionTransform.Y = SelectionPoint.Y - (colorPlane.ActualHeight / 2); ProcessSliderEvents = false; sNormal.Minimum = cc.MinValue; sNormal.Maximum = cc.MaxValue; sNormal.Value = cc.Value(Color); ProcessSliderEvents = true; cc.UpdateNormalBitmap(mNormalPane, Color); cc.UpdateColorPlaneBitmap(mSelectionPane, cc.Value(Color)); }
private void ProcessMousedown(Point selectionPoint) { SelectionPoint = selectionPoint; selectionTransform.X = SelectionPoint.X - (colorPlane.ActualWidth / 2); selectionTransform.Y = SelectionPoint.Y - (colorPlane.ActualHeight / 2); var newColor = NormalComponent.ColorAtPoint(SelectionPoint, (int)sNormal.Value); if (!NormalComponent.IsNormalIndependantOfColor) { NormalComponent.UpdateNormalBitmap(mNormalPane, newColor); } Color = newColor; }
private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) { if (colorPlaneColorComponent.Name == "HSB_Hue") { rH.IsChecked = true; } else if (colorPlaneColorComponent.Name == "HSB_Saturation") { rS.IsChecked = true; } else if (colorPlaneColorComponent.Name == "HSB_Brightness") { rB.IsChecked = true; } else { rH.IsChecked = false; rS.IsChecked = false; rB.IsChecked = false; } if (ColorComponentChanged != null) ColorComponentChanged(this, new EventArgs<NormalComponent>(colorPlaneColorComponent)); }
private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) { if (colorPlaneColorComponent.Name == "LAB_Lightness") { rL.IsChecked = true; } else if (colorPlaneColorComponent.Name == "LAB_A") { rA.IsChecked = true; } else if (colorPlaneColorComponent.Name == "LAB_B") { rB.IsChecked = true; } else { rL.IsChecked = false; rA.IsChecked = false; rB.IsChecked = false; } }
private void OnColorComponentChanged(NormalComponent colorPlaneColorComponent) { if (colorPlaneColorComponent.Name == "RGB_Red") { rR.IsChecked = true; } else if (colorPlaneColorComponent.Name == "RGB_Green") { rG.IsChecked = true; } else if (colorPlaneColorComponent.Name == "RGB_Blue") { rB.IsChecked = true; } else { rR.IsChecked = false; rG.IsChecked = false; rB.IsChecked = false; } if (ColorComponentChanged != null) { ColorComponentChanged(this, new EventArgs<NormalComponent>(colorPlaneColorComponent)); } }
private void rR_Checked(object sender, RoutedEventArgs e) { NormalComponent = sRed; if (ColorComponentChanged != null) { ColorComponentChanged(this, new EventArgs<NormalComponent>(sRed)); } }
private void rS_Checked(object sender, RoutedEventArgs e) { NormalComponent = sSaturation; }
private void rB_Checked(object sender, RoutedEventArgs e) { NormalComponent = sB; }
private void rB_Checked(object sender, RoutedEventArgs e) { NormalComponent = sBrightness; }
private void rL_Checked(object sender, RoutedEventArgs e) { NormalComponent = sLightness; }
private void rH_Checked(object sender, RoutedEventArgs e) { NormalComponent = sHue; }