Alessandro Del Sole's Blog

/* A programming space about Microsoft® .NET® */
posts - 159, comments - 0, trackbacks - 0

My Links


Your host

This is me! This space is about Microsoft® .NET® and Microsoft® Visual Basic development. Enjoy! :-)

These postings are provided 'AS IS' for entertainment purposes only with absolutely no warranty expressed or implied and confer no rights.

Microsoft MVP

My MVP Profile

I'm a VB!

Watch my interview in Seattle

My new book on VB 2015!

Pre-order VB 2015 Unleashed Pre-order my new book "Visual Basic 2015 Unleashed". Click for more info!

My new book on LightSwitch!

Visual Studio LightSwitch Unleashed My book "Visual Studio LightSwitch Unleashed" is available. Click the cover!

Your visits

Follow me on Twitter!

CodePlex download Download my open-source projects from CodePlex!

Article Categories


Post Categories

.NET Framework


Help Authoring

Microsoft & MSDN

Setup & Deployment

Visual Basic 2005/2008/2010

BevelBitmapEffect in WPF

In Windows Presentation Foundation, according to the hyerarchical structure of XAML, we can apply a lot of graphical effects not only to images but also to controls. In this sample we're going to see how to use the BevelBitmapEffect effect, which renders the control to which it's applied in a 3D way (we could say "buttonized"). We'll see how to apply it to an image and to a button.

Run Visual Basic 2008 and create a new WPF empty project. The, type the following XAML code from within the Window element:


      <Button Width="150" Height="60" Margin="10,10,10,10">


        <BevelBitmapEffect BevelWidth="10" EdgeProfile="CurvedIn"

                           Smoothness="0.5" Relief="0.3" LightAngle="320" />


        Ciao WPF!



      <Image Source="logovbtt.gif" >


          <BevelBitmapEffect BevelWidth="15" EdgeProfile="CurvedOut"

                             Smoothness="0.3" Relief="0.4" LightAngle="180" />




As you can see, both the elements Button and Image define a property called BitmapEffect. Inside this property we can add all the effects we want to apply. About BevelBitmapEffect, we have then defined some features through the following attributes: Width (which establishes the width of the 3D effect), EdgeProfile (which establishes the direction that the effect must take onto the control), LightAngle (which indicates the angle of lightening, which is on the right for the button and on the left for the picture), Smoothness (which is about shadows) and Relief (self-describing :-) ).

The following is the result you get just running the new application:



Print | posted on martedì 14 aprile 2009 14:24 | Filed Under [ Windows Presentation Foundation ]


No comments posted yet.

Post Comment

Please add 5 and 6 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET