Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to change the angle of an xaml wdf image angle parameter by VB.net code in runtime?

I have a image that transformed in design time to get it specific angle. XAML is like below.

<Image x:Name="Yelkovan" HorizontalAlignment="Left" Height="163" Margin="178,80,0,0" VerticalAlignment="Top" Width="14" Source="/k-yelkovan.png" RenderTransformOrigin="0.558,0.863">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="-30"/>
                    <TranslateTransform X="27.336" Y="-7.117"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>

I want to set angle by vb.net code in runtime, ie when press a button, set its transform angle from -30 to ie : +45 deg only. How is this possible?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can give your RotateTransform a name:

<RotateTransform x:Name="Rotation"  Angle="-30"/>

Then you can access it like a control:

Me.Rotation.Angle = -25
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading