Posts
17
Comments
79
Trackbacks
54
Using BitmapEffects

“You can easily apply effects like Blur or DropShadows to a UI element using BitmapEffects property.

This xaml sample:

<Image HorizontalAlignment="Left" VerticalAlignment="Top" Source="cor.jpg">
 <Image.BitmapEffect>
  <BitmapEffectGroup>
   <BitmapEffectGroup.Children>
    <BitmapEffectCollection>
      <BlurBitmapEffect Radius="2"/>
      <DropShadowBitmapEffect/>
    </BitmapEffectCollection>
   </BitmapEffectGroup.Children>
  </BitmapEffectGroup>
 </Image.BitmapEffect>
</Image> 
<TextBox Text="Hello WPF">
 <TextBox.BitmapEffect> 
  <BitmapEffectGroup>
    <BitmapEffectGroup.Children>
     <BitmapEffectCollection>
      <OuterGlowBitmapEffect GlowColor="Green" GlowSize="5" Noise="3"  />
      <DropShadowBitmapEffect/>
     </BitmapEffectCollection>
    </BitmapEffectGroup.Children>
  </BitmapEffectGroup> 
 </TextBox.BitmapEffect>
</TextBox>
Produces this effect:

As you can see various effects can be applied to the same element, just keep in mind that effects are processed in sequence so the order of appearance inside counts.”
Unfortunately Sparkle does not support direct editing of this property yet.

posted on venerdì 10 febbraio 2006 17.52 Print
Comments
Gravatar
# re: Using BitmapEffects
marco
27/08/2007 10.25
  
Hi Corrado,
a question about BitmapEffect. If I set a BitmapEffect on a Canvas which contains a TextBox, the editing of the TextBox becomes very slow. Removing the BitmapEffect the editing is normal. Have you tried this scenario? Doyou have the same terrible effect?
Thanks for your time
ciao
marco
Gravatar
# re: Using BitmapEffects
Corrado Cavalli
27/08/2007 10.46
  
Hi Marco,
BitmapEffects are software accellerated so they're slow by nature :-)
Did a quick test using Blend2 on a VM and, on a very simple project, didn't noticed a big performace degradation, but can't exclude it on canvas with lots of controls.
I see solutions that use adorners for the drop shadow effect in place of BitmapEffect.
Also note that BitmapEffects aren't supported on XBap applications
Ciao
Corrado
Gravatar
# re: Using BitmapEffects
Ivan
16/12/2007 20.49
  
Marco, I also noticed a significant slowdown with the wpf textbox while typing when I included it in an element that had a BitmapEffect.
Gravatar
# re: Web Parts e Ajax.. matrimonio possibile?
加盟网
25/08/2008 13.03
  
涤棉布
丙纶丝专业供应商
Gravatar
# re: Using BitmapEffects
leon
06/11/2008 8.01
  
棉布
Gravatar
# re: Using BitmapEffects
棉布
06/11/2008 8.06
  
helllo

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 6 and 5 and type the answer here:
News

This is my personal blog.
These postings are provided "AS IS" with no warranties, and confer no rights.

Disciple