private void AnchorPixelControl_OpacityChangeRequested(object sender, EventArgs e) { SetOpacityWindow window = new SetOpacityWindow(); AnchorPixelControl pix = (AnchorPixelControl)sender; window.ShowDialog(pix.AnchPixOpacity); if ((bool)window.DialogResult) { pix.AnchPixOpacity = window.AnchPixelOpacity; UpdateAnchorPixelOpacity(pix); if (pix.AnchPixOpacity == 255) { OnAnchorPixelChanged(); UpdateOpacityApplied(); } else { UpdateOpacityApplied(); OnAnchorPixelChanged(); } } }
private void UpdateAnchorPixelColor(AnchorPixelControl aPix) { GradientState.AnchPixs[AnchorPixels.IndexOf(aPix)].CH0 = aPix.Color.R; GradientState.AnchPixs[AnchorPixels.IndexOf(aPix)].CH1 = aPix.Color.G; GradientState.AnchPixs[AnchorPixels.IndexOf(aPix)].CH2 = aPix.Color.B; }
private void UpdateAnchorPixelOpacity(AnchorPixelControl aPix) { GradientState.AnchPixs[AnchorPixels.IndexOf(aPix)].CH3 = aPix.AnchPixOpacity; }
private void UpdateAnchorPixelLocation(AnchorPixelControl aPix) { GradientState.AnchPixs[AnchorPixels.IndexOf(aPix)].X = (Int32)((Canvas.GetLeft(aPix) + Constants.AnchPixelControlDragOffset) / ZoomFactor + ViewportLocationX); GradientState.AnchPixs[AnchorPixels.IndexOf(aPix)].Y = (Int32)((Canvas.GetTop(aPix) + Constants.AnchPixelControlDragOffset) / ZoomFactor + ViewportLocationY); }