SolidColorBrush Opacity property from 1 to 0 : SolidColorBrush « Windows Presentation Foundation « C# / C Sharp






SolidColorBrush Opacity property from 1 to 0

SolidColorBrush Opacity property from 1 to 0
 
<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">

    <StackPanel>
        <Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1" >
          <Rectangle.Fill>
            <SolidColorBrush Color="Blue" Opacity="1" />
          </Rectangle.Fill>
        </Rectangle>
        <Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1">
          <Rectangle.Fill>
            <SolidColorBrush Color="Blue" Opacity="0.75" />
          </Rectangle.Fill>
        </Rectangle>
        <Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1">
          <Rectangle.Fill>
            <SolidColorBrush Color="Blue" Opacity="0.5" />
          </Rectangle.Fill>
        </Rectangle>
        <Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1">
          <Rectangle.Fill>
            <SolidColorBrush Color="Blue" Opacity="0.25" />
          </Rectangle.Fill>
        </Rectangle>
        <Rectangle Width="100" Height="50" Stroke="Black" StrokeThickness="1">
          <Rectangle.Fill>
            <SolidColorBrush Color="Blue" Opacity="0" />
          </Rectangle.Fill>
        </Rectangle>
    </StackPanel>
</Window>

   
  








Related examples in the same category

1.The Color property of this rectangle's SolidColorBrush is animated.The Color property of this rectangle's SolidColorBrush is animated.
2.The Color property of the SolidColorBrush used to fill this rectangle is animatedThe Color property of the SolidColorBrush used to fill this rectangle is animated
3.The Opacity property of this rectangle's SolidColorBrush is animatedThe Opacity property of this rectangle's SolidColorBrush is animated
4.SolidColorBrush objects: Brushes.Red, Brushes.MediumBlue,Brushes.Purple, and Brushes.GoldSolidColorBrush objects: Brushes.Red, Brushes.MediumBlue,Brushes.Purple, and Brushes.Gold
5.SolidColorBrush described using 3-digit hexadecimal notation: amount of red, green, and blue in the color.SolidColorBrush described using 3-digit hexadecimal notation: amount of red, green, and blue in the color.
6.SolidColorBrush described using 6-digit hexadecimal notation.SolidColorBrush described using 6-digit hexadecimal notation.
7.SolidColorBrush described using 8-digit hexadecimal notation.SolidColorBrush described using 8-digit hexadecimal notation.
8.SolidColorBrush's Color property is specified using one of the predefined colors defined by the System.Windows.Media.Colors classSolidColorBrush's Color property is specified using one of the predefined colors defined by the System.Windows.Media.Colors class
9.SolidColorBrush's color is specified using 3-digit hexadecimal notation.SolidColorBrush's color is specified using 3-digit hexadecimal notation.
10.SolidColorBrush's color is specified using 6-digit hexadecimal notation.SolidColorBrush's color is specified using 6-digit hexadecimal notation.
11.SolidColorBrush's color is specified using 8-digit hexadecimal notation.SolidColorBrush's color is specified using 8-digit hexadecimal notation.