.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Articles >> WPF >> Post New Resource Bookmark and Share   

 Subscribe to Articles

WPF Bitmap Effects Tutorial - Part II

Posted By:Diptimaya Patra       Posted Date: May 28, 2010    Points: 25    Category: WPF    URL: http://www.dotnetspark.com  

WPF Bitmap Effects Tutorial. In this article we will see rest of the 3 Bitmap Effects Drop Shadow Bitmap Effects, Bevel Bitmap Effect and Emboss Bitmap Effect.

Drop Shadow Bitmap Effect

You can also read Part 1 of this series

This Bitmap Effect created a shadow behind the object.

This effect is best suited for Panels like Borders, TreeView, ListBox etc.

Let's add some controls like those and see the difference.

The problem with effects is whenever a parent is given an effect the children would also inherit from it. Until and unless we define explicitly effects for each child, this is not good.



As you see above the children are also having the same effect applied to parent Border.

There is only one work around for this, let's say you have the Border with effect. Just have another border with same position but without the effect, that would resolve the problem.

See below image:


For DropShadow BitmapEffect we have properties like Color, ShadowDepth, Direction.

Direction is the property which decides which direction you want the shadow. It's basically the angle of X axis, so you can rotate your angle based on your choice.


As you see the above image we have set the Direction to 180.

Bevel Bitmap Effect

This effect creates a bevel which raises the surface of an image according to a specified curve.

As said above, it is best suited for Images, though it can be applied to any control.


As you see above we have effect best visible for images. The left image is with Bevel Bitmap Effect and the right image is without any effect.

This effect has properties like BevelWidth and EdgeProfile.


Edge Profile has four different types.

Emboss Bitmap Effect

This bitmap Effect creates a bump mapping of a Visual to give the impression of depth and texture from an artificial light source.

Again this effect is best suited for Images.


As you see above the left image is having the Emboss effect and the right side image is without any effect.

This effect has two properties as LightAngle and Relief.

If Relief is not used the image would be darkened.

You can also download the sample project used in the above example.

Hope this article helps.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend