Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }