Example #1
0
        partial void Update(UITapGestureRecognizer sender)
        {
            UIImage effectImage = null;
            var     effectText  = string.Empty;
            var     effectColor = UIColor.White;

            switch (currentEffect)
            {
            case EffectType.None:
                currentEffect = EffectType.Light;

                effectImage = image.ApplyLightEffect();
                effectText  = "Light";
                break;

            case EffectType.Light:
                currentEffect = EffectType.ExtraLight;

                effectImage = image.ApplyExtraLightEffect();
                effectText  = "Extra Light";
                effectColor = UIColor.LightGray;
                break;

            case EffectType.ExtraLight:
                currentEffect = EffectType.Dark;

                effectImage = image.ApplyDarkEffect();
                effectText  = "Dark";
                effectColor = UIColor.DarkGray;
                break;

            case EffectType.Dark:
                currentEffect = EffectType.ColorTint;

                effectImage = image.ApplyTintEffect(UIColor.Blue);
                effectText  = "Color tint";
                effectColor = UIColor.DarkGray;
                break;

            case EffectType.ColorTint:
                currentEffect = EffectType.None;

                effectImage = image;
                break;
            }

            imageView.Image       = effectImage;
            effectLabel.Text      = effectText;
            effectLabel.TextColor = effectColor;
        }
Example #2
0
        void UpdateImage(UITapGestureRecognizer recognizer)
        {
            if (imageIndex > 4)
            {
                imageIndex = 0;
            }

            string  effectText  = "";
            UIImage effectImage = null;

            switch (imageIndex)
            {
            case 0:
                effectImage = image;
                break;

            case 1:
                effectImage           = image.ApplyLightEffect();
                effectText            = "Light";
                effectLabel.TextColor = UIColor.White;
                break;

            case 2:
                effectImage           = image.ApplyExtraLightEffect();
                effectText            = "Extra Light";
                effectLabel.TextColor = UIColor.LightGray;
                break;

            case 3:
                effectImage           = image.ApplyDarkEffect();
                effectText            = "Dark";
                effectLabel.TextColor = UIColor.DarkGray;
                break;

            case 4:
                effectImage           = image.ApplyTintEffect(UIColor.Blue);
                effectText            = "Color tint";
                effectLabel.TextColor = UIColor.DarkGray;
                break;

            default:
                break;
            }

            imageView.Image  = effectImage;
            effectLabel.Text = effectText;

            imageIndex++;
        }