Ask a questionAsk a question
 

Proposed AnswerBevel Effect

  • Wednesday, July 01, 2009 4:06 PMJLLO Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have a developer that love to used the Bevel Bitmap effect but it kills performance, does anyone know if this will be supported as a Hardware rendered effect or if there is a way to do this without a performance hit.

All Replies

  • Wednesday, July 01, 2009 7:36 PMVLTII Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed AnswerHas Code
    You can always fake a hard bevel with a reflected gradient on the stroke... something like this:

    	<Border Padding="5">
    		<Border.Background>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    				<GradientStop Color="#FF000000" Offset="0"/>
    				<GradientStop Color="#FF2B2B2B" Offset="1"/>
    			</LinearGradientBrush>
    		</Border.Background>
    		<Border BorderThickness="2,2,2,2" CornerRadius="10,10,10,10" Margin="20,20,20,20" Background="#FF838383">
    			<Border.BorderBrush>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
    					<GradientStop Color="#FF000000" Offset="0.474"/>
    					<GradientStop Color="#FFFFFFFF" Offset="1"/>
    					<GradientStop Color="#FFFFFFFF" Offset="0"/>
    				</LinearGradientBrush>
    			</Border.BorderBrush>
    		</Border>		
    	</Border>
    

    www.LeonTerry.com
    • Proposed As Answer byVLTII Wednesday, July 01, 2009 7:36 PM
    •  
  • Thursday, July 02, 2009 10:00 PMBrennon WilliamsMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Howdy,

    Leon's answer is the best for a bevel specifically at present. I wasnt able to find a HLSL solution for you but thought I would provide this link should you have further effects requirements.

    http://www.codeplex.com/wpffx

    It was also discussed here:

    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d19828e7-560e-4733-97b4-63326be8390c

    Sorry cant give you a plugin solution at the moment.

    Cheers

    Expression MVP

    my blog : http://x-coders.com/blogs/sneaky/default.aspx