Blog Content

    티스토리 뷰

    34.SilverLight3 - Brush : OpacityMask

    반응형


    MainPage.xaml

    [그림 34-1]


    <UserControl x:Class="OpacityMask.MainPage"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

        mc:Ignorable="d"

        d:DesignHeight="600" d:DesignWidth="400">

     

        <Canvas Width="268" Height="490" Background="White">

            <Image Canvas.Left="20" Canvas.Top="20" Source="Images\\j2.jpg" Height="150">

                <Image.OpacityMask>

                    <RadialGradientBrush Center="0.5,0.5">

                        <!-- -->

                        <GradientStop Color="#00000000" Offset="1"></GradientStop>

                        <!-- -->

                        <GradientStop Color="#20000000" Offset="0.8"></GradientStop>

                        <!-- -->

                        <GradientStop Color="#FF000000" Offset="0"></GradientStop>

                    </RadialGradientBrush>

                </Image.OpacityMask>

            </Image>

     

            <Image Canvas.Top="180" Canvas.Left="20" Source="Images\\j2.jpg" Height="150">

            </Image>


            <Image Canvas.Left="20" Canvas.Top="480" Source="Images\\j2.jpg" Height="150">

                <Image.RenderTransform>

                    <!-- (Ya) 기-->

                    <ScaleTransform ScaleY="-1"></ScaleTransform>

                </Image.RenderTransform>


                <Image.OpacityMask>

                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">

                        <!-- -->

                        <GradientStop Offset="0.1" Color="#00000000"></GradientStop>

                        <GradientStop Offset="0.5" Color="#55000000"></GradientStop>

                    </LinearGradientBrush>

                </Image.OpacityMask>

            </Image>

        </Canvas>

    </UserControl>



    반응형

    Comments