Live Chat Icon For mobile
Live Chat Icon

How do I apply Transform when an event is occurred ?

Platform: WPF| Category: 2D Graphics

Any type of transform can be applied when an event has occurred.

The following lines of code apply a ’RotateTransform’ when the mouse is moved over the image.


<Image Source='pda.ico' MouseEnter='Image_MouseEnter' MouseLeave='Image_MouseLeave'>
<RotateTransform Angle='0' x:Name='ImageRot'/>

private void Image_MouseEnter(object sender, MouseEventArgs e)
ImageRot.Angle = 30;
private void Image_MouseLeave(object sender, MouseEventArgs e)
ImageRot.Angle = 0;

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.