how to make the animation starts in all direction
-
hello When Mouse over the image I will make it bigger by making a small trigger and when the mouse leave Image will return to its original size BUT when mouse over the image will turn to big BUT the Left Upper point will still fixed I mean I want to make it bigger in all direction :)
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
-
hello When Mouse over the image I will make it bigger by making a small trigger and when the mouse leave Image will return to its original size BUT when mouse over the image will turn to big BUT the Left Upper point will still fixed I mean I want to make it bigger in all direction :)
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
If you're using a ScaleTransform, you can set its CenterX/CenterY properties appropriately, for example:
<Image Source="images/Silverlight\_Logo.jpg" Stretch="None" > <Image.RenderTransform> `<!-- image is 58x66 -->` <ScaleTransform `CenterX="29" CenterY="33"` /> </Image.RenderTransform> <Image.Triggers> <EventTrigger RoutedEvent="Image.MouseEnter"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)" From="1" To="2" Duration="0:0:0.1" /> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)" From="1" To="2" Duration="0:0:0.1" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> <EventTrigger RoutedEvent="Image.MouseLeave"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)" From="2" To="1" Duration="0:0:0.1" /> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)" From="2" To="1" Duration="0:0:0.1" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Image.Triggers> </Image>
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
If you're using a ScaleTransform, you can set its CenterX/CenterY properties appropriately, for example:
<Image Source="images/Silverlight\_Logo.jpg" Stretch="None" > <Image.RenderTransform> `<!-- image is 58x66 -->` <ScaleTransform `CenterX="29" CenterY="33"` /> </Image.RenderTransform> <Image.Triggers> <EventTrigger RoutedEvent="Image.MouseEnter"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)" From="1" To="2" Duration="0:0:0.1" /> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)" From="1" To="2" Duration="0:0:0.1" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> <EventTrigger RoutedEvent="Image.MouseLeave"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)" From="2" To="1" Duration="0:0:0.1" /> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)" From="2" To="1" Duration="0:0:0.1" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Image.Triggers> </Image>
Mark Salsbery Microsoft MVP - Visual C++ :java:
thanks Mark it works well the image size is dynamic so I will set the CenterX and CenterY By Code after getting the Actual width for the image . :)
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
-
thanks Mark it works well the image size is dynamic so I will set the CenterX and CenterY By Code after getting the Actual width for the image . :)
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
Feras Mazen Taleb wrote:
it works well
Cool :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
If you're using a ScaleTransform, you can set its CenterX/CenterY properties appropriately, for example:
<Image Source="images/Silverlight\_Logo.jpg" Stretch="None" > <Image.RenderTransform> `<!-- image is 58x66 -->` <ScaleTransform `CenterX="29" CenterY="33"` /> </Image.RenderTransform> <Image.Triggers> <EventTrigger RoutedEvent="Image.MouseEnter"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)" From="1" To="2" Duration="0:0:0.1" /> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)" From="1" To="2" Duration="0:0:0.1" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> <EventTrigger RoutedEvent="Image.MouseLeave"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)" From="2" To="1" Duration="0:0:0.1" /> <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)" From="2" To="1" Duration="0:0:0.1" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Image.Triggers> </Image>
Mark Salsbery Microsoft MVP - Visual C++ :java:
Are the blushing smilies valid XAML?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Are the blushing smilies valid XAML?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001I agonized (:rolleyes:) over invalidating the XAML to get rid of the smilies, or leave it valid because it makes me laugh... my final choice is clear. Maybe someday the site with "Code" in its name will have an easy way to enter code in posts....even Microsoft managed to pull that off... To answer your question: Yes.
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
thanks Mark it works well the image size is dynamic so I will set the CenterX and CenterY By Code after getting the Actual width for the image . :)
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
Use the following code:
Regards, - K (My Blog)
-
Use the following code:
Regards, - K (My Blog)
Nice one Centurion! :)
Mark Salsbery Microsoft MVP - Visual C++ :java: