Brush : 실버라이트에서는 단색, 선형, 방사형, 이미지, 비디오, 같은 다양한 브러쉬 효과 존재 - Brush(브러시) : Shape 내부 채우기 - SolidColorBrush : 단색 - LinearGradientBrush : 선형 - RadialGradientBrush : 원형(방사형) - ImageBrush : 이미지 - VideoBrush : 비디오 |
MainPage.Xaml <UserControl x:Class="RiaSolidColorBrush.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="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <Canvas Width="200" Height="200" Background="Yellow"> <Rectangle Canvas.Left="0" Canvas.Top="0" Width="100" Height="100"> <Rectangle.Fill> <SolidColorBrush Color="Red"></SolidColorBrush> </Rectangle.Fill> </Rectangle> <Rectangle Canvas.Left="100" Canvas.Top="0" Width="100" Height="100"> <Rectangle.Fill> <SolidColorBrush Color="Silver"></SolidColorBrush> </Rectangle.Fill> </Rectangle> <Rectangle Canvas.Left="0" Canvas.Top="100" Width="100" Height="100"> <Rectangle.Fill> <SolidColorBrush Color="#000000FF"></SolidColorBrush> </Rectangle.Fill> </Rectangle> <Rectangle Canvas.Left="100" Canvas.Top="100" Width="100" Height="100"> <Rectangle.Fill> <SolidColorBrush Color="#A00000FF"></SolidColorBrush> </Rectangle.Fill> </Rectangle> </Canvas> </Grid> </UserControl> |
SolidColorBrush.Xaml <UserControl x:Class="RiaSolidColorBrush.FrmSolidColorBrush" 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="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <StackPanel> <Ellipse Fill="Yellow" Stroke="Red" Width="100" Height="100"> </Ellipse> <StackPanel> <Ellipse Fill="Yellow" Stroke="Red" Height="100" Width="100"></Ellipse> </StackPanel> </StackPanel> </Grid> </UserControl> |
'.Net Project > SilverLight 3.0' 카테고리의 다른 글
24장) 실버라이트 방사형 그라데이션 (RadialGradientBrush) (0) | 2009.11.27 |
---|---|
23장) 실버라이트 선형 그라데이션 (GradientBrush) (0) | 2009.11.27 |
21장) 실버라이트 스트로크 관련 (Stroke) (0) | 2009.11.27 |
20장) 실버라이트 복합 기하도형 (PathGeometry) (0) | 2009.11.26 |
19장) 실버라이트 복합 기하도형 (PathFigure) (0) | 2009.11.26 |