private void SaturationAdjustmentTimer_Tick(object sender, EventArgs e) { _saturationAdjustmentTimer.Stop(); _CurrentSaturation += SaturationAdjustment * _SaturationAdjustmentVector; if (_CurrentSaturation < CustomSaturationValue) { _CurrentSaturation = CustomSaturationValue; } if (_CurrentSaturation > OriginalSaturationValue) { _CurrentSaturation = OriginalSaturationValue; } SampleGallery.InvalidateItems(); if (_CurrentSaturation == CustomSaturationValue) { return; } if (_CurrentSaturation == OriginalSaturationValue) { SampleGallery.ItemDrawMode = GalleryItemDrawMode.CenterImage; return; } _saturationAdjustmentTimer.Start(); }
private void CustomPaintingDemoToggleButton_PressedChanged(object sender, EventArgs e) { _saturationAdjustmentTimer.Stop(); if (CustomPaintingDemoToggleButton.Pressed) { SampleGallery.ItemDrawMode = GalleryItemDrawMode.OwnerDrawWithStandardBackground; } _SaturationAdjustmentVector = CustomPaintingDemoToggleButton.Pressed ? -1 : 1; _saturationAdjustmentTimer.Start(); SampleGallery.InvalidateItems(); }