Exemple #1
0
        public GradientRenderer CreateGradientRenderer()
        {
            UserBlendOps.NormalBlendOp normalBlendOp = new UserBlendOps.NormalBlendOp();

            switch (this.gradientType)
            {
                case GradientType.LinearClamped:
                    return new GradientRenderers.LinearClamped(this.alphaOnly, normalBlendOp);

                case GradientType.LinearReflected:
                    return new GradientRenderers.LinearReflected(this.alphaOnly, normalBlendOp);

                case GradientType.LinearDiamond:
                    return new GradientRenderers.LinearDiamond(this.alphaOnly, normalBlendOp);
                    
                case GradientType.Radial:
                    return new GradientRenderers.Radial(this.alphaOnly, normalBlendOp);

                case GradientType.Conical:
                    return new GradientRenderers.Conical(this.alphaOnly, normalBlendOp);

                default:
                    throw new InvalidEnumArgumentException();
            }
        }
Exemple #2
0
        public override Surface RenderThumbnail(int maxEdgeLength)
        {
            Size thumbSize = Utility.ComputeThumbnailSize(this.Size, maxEdgeLength);
            Surface thumb = new Surface(thumbSize);

            thumb.SuperSamplingFitSurface(this.surface);

            Surface thumb2 = new Surface(thumbSize);
            thumb2.ClearWithCheckboardPattern();
            UserBlendOps.NormalBlendOp nbop = new UserBlendOps.NormalBlendOp();
            nbop.Apply(thumb2, thumb);

            thumb.Dispose();
            thumb = null;

            return thumb2;
        }
        protected override void InitDialogFromToken(EffectConfigToken effectToken)
        {
            base.InitDialogFromToken(effectToken);

            UserBlendOp setOp = ((CloudsEffectConfigToken)effectToken).BlendOp;

            if (setOp == null)
            {
                setOp = new UserBlendOps.NormalBlendOp();
            }

            foreach (object op in this.comboBlendModes.Items)
            {
                if (0 == string.Compare(op.ToString(), setOp.ToString(), StringComparison.CurrentCultureIgnoreCase))
                {
                    this.comboBlendModes.SelectedItem = op;
                    break;
                }
            }
        }