Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
Search :       Advanced Search �
Home

Author Rank :
Page Views :
Downloads : 0
Rating :
 Rate it
Level :
Become a Sponsor
Tags


I was wondered about the variety of effects in Blend 4 for Silverlight developers and am going to talk about it over a series of articles.  First in this series would be the ripple effect, which helps you to create a fluid like surface.  And of, course you need Expression Blend 4 to do this. 

First things first, open a Blend 4 application and select a new Silverlight Project   In this sample application; I had used this effect on an image control.  What it primarily does is give a fluid like effect on the control to which it is applied.

Here is the objects used in my application

1.gif
 
Just add a reference to the Microsoft.Expression.Effects.dll present in %windir%\Program Files\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries folder.

Now select the image and click on effects.  You will see an additional option of effects there, like

2.gif
 
Expand the Namespace and select Ripple Effect from that. You will get 4 options like this.

3.gif
 
I played with this and found out that Frequency, Magnitude and Phase talks about the waves that are formed as ripples.  It was interesting to play with that and make it zero finally.

Now create a storyboard which begins like,

4.gif
 
Note that we had we had set the values zero in normal scenario and we are setting it in beginning of storyboard. And in the end make it zero again. Like,

5.gif
 
Now we are all set.  In mouse down event handler of image, put the code like,

private void image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    Point p=e.GetPosition(image);
    p.X /= 175 ;
    p.Y /= 175 ;
    ImgRipple.Center=p;
    sbRipple.Begin();
}

Now run the application and voila, it just is liquid.

I had attached the source code and hope you enjoy this.

 [Top] Rate this article
 
 About the author
 
Author
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
 Comments

 � 2024  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.