Exemple #1
0
        /// <inheritdoc/>
        protected override string WriteCompositeEffectFactory(CodeBuilder builder, Mgce.CompositeEffect compositeEffect)
        {
            var compositeEffectString = "compositeEffect";

            builder.WriteLine($"var {compositeEffectString} = new CompositeEffect();");
            builder.WriteLine($"{compositeEffectString}.Mode = {_stringifier.CanvasCompositeMode(compositeEffect.Mode)};");
            foreach (var source in compositeEffect.Sources)
            {
                builder.WriteLine($"{compositeEffectString}.Sources.Add(new CompositionEffectSourceParameter({String(source.Name)}));");
            }

            return(compositeEffectString);
        }
Exemple #2
0
        /// <inheritdoc/>
        protected override string WriteCompositeEffectFactory(CodeBuilder builder, Mgce.CompositeEffect compositeEffect)
        {
            builder.WriteLine("ComPtr<CompositeEffect> compositeEffect(new CompositeEffect());");
            builder.WriteLine($"compositeEffect->SetMode({_stringifier.CanvasCompositeMode(compositeEffect.Mode)});");
            foreach (var source in compositeEffect.Sources)
            {
                builder.OpenScope();
                builder.WriteLine($"auto sourceParameter = ref new CompositionEffectSourceParameter({String(source.Name)});");
                builder.WriteLine("compositeEffect->AddSource(reinterpret_cast<ABI::Windows::Graphics::Effects::IGraphicsEffectSource*>(sourceParameter));");
                builder.CloseScope();
            }

            return("reinterpret_cast<Windows::Graphics::Effects::IGraphicsEffect^>(compositeEffect.Get())");
        }