ARTICLE

Bitmap Effect in WPF: Part 5

Posted by Manish Tewatia Articles | WPF using VB.NET September 20, 2010
In this article you learn deeply about the all types of Bitmap Effects in WPF.
 
Reader Level:

As you learn about the BevelBitmapEffect in my previous article, now you will see the working of OuterGlowBitmapEffect.

OuterGlowBitmapEffect: OuterGlowBitmapEffect is one of several effects that are shipped with the Windows SDK. You can control the color (GlowColor), the width of the glow effect (GlowSize, which defaults to 5), the sharpness of the glow (Noise, which takes a value between 0 and 1), and whether content underneath shows through the halo (Opacity, which also takes a value between 0 and 1).

This bitmap effect creates a halo of color around the perimeter of an object, we have two different properties such as GlowColor and GlowSize that would determine the effect. assigning an OuterGlowBitmapEffect element to the BitmapEffect property of an element creates a glowing halo around the target element according to the configuration of the OuterGlowBitmapEffect element. The BitmapEffect property is declared by the System.Windows.UIElement clas, which means you can apply a glow effect to anything that inherits from UIElement, Which includes all the standard control and graphics elements.

Example of OuterGlowBitmapEffect

<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <StackPanel>
        <Button Margin="11" Content="Button 1">
            <Button.BitmapEffect>
                <OuterGlowBitmapEffect GlowColor="Blue" GlowSize="5" />
            </Button.BitmapEffect>
        </Button
        <Button Margin="11" Content="Button 2">
            <Button.BitmapEffect>
                <OuterGlowBitmapEffect GlowColor="Green" GlowSize="5" />
            </Button.BitmapEffect>
        </Button>
    </StackPanel>
</
Window>

Output Window

bit5.gif

Conclusion

Hope this article clear to you and help to understand the OuterGlowBitmapEffect in WPF.

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Team Foundation Server Hosting
Become a Sponsor