简体   繁体   English

如何在c#后面的代码中应用应用RenderTransform?

[英]How to apply the apply the RenderTransform in code behind in c#?

I am new for RenderTransform, I need to apply the below RenderTransform in code behind(C#)我是 RenderTransform 的新手,我需要在后面的代码中应用以下 RenderTransform(C#)

  <local:Container.RenderTransform>
         <CompositeTransform x:Name="visualCoinatiner_transform" />
  </local:Container.RenderTransform> 

Any suggestion on this?对此有何建议?

We can apply the RenderTransform in code behind like below code,我们可以像下面的代码一样在后面的代码中应用 RenderTransform,

private CompositeTransform _compositeTransform;
_compositeTransform = new CompositeTransform();
this.RenderTransform = _compositeTransform;

yes, thank you for this answer.是的,谢谢你的回答。 Just to build on it a little, flip a MediaPlayerElement both horizontally and vertically:只是为了建立一点,水平和垂直翻转 MediaPlayerElement:

thisMPElement = Canvas.FindName("NameOfXAMLElement") as MediaPlayerElement;
var cp = new CompositeTransform()
{
    ScaleX = -1,
    ScaleY = -1
};
thisMPElement.RenderTransform = cp;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RenderTransform WPF /代码背后 - Rendertransform wpf/code behind 使用^ [A-Za-z] [A-Za-z0-9!@#$%^&*] * $ reg验证密码如何在c#代码后面应用长度 - using ^[A-Za-z ][A-Za-z0-9!@#$%^&* ]*$ reg validation password how apply length in c# code behind 是否可以将RenderTransform应用于实际的UIElement? - Is it possible to apply RenderTransform to the actual UIElements? 如何使用Storyboard在网格上应用RenderTransform.TranslateTransform? - How to apply a RenderTransform.TranslateTransform on a Grid using a Storyboard? 如何使用C#代码将Transform MST应用于MSI? - How to Apply an Transform mst to msi using c# code? 如何在后面的代码中应用materialDesign:ColorZoneAssist.Mode =“ Accent” - How to apply materialDesign:ColorZoneAssist.Mode=“Accent” in code behind 如何在后面的代码中将自定义样式应用于自定义控件 - How to apply a customized style to a custom control in code behind 如何将 ResourceDictionary 样式应用于代码隐藏文件中的控件 - How to apply a ResourceDictionary style to a control in the code behind file 如何从背后的代码中删除Telerik RadColorPicker中的“应用”按钮 - How to Remove Apply Button in a Telerik RadColorPicker From Code Behind 将RenderTransform元素绑定到代码隐藏变量 - Bind RenderTransform elements to code-behind variables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM