<ImageBrush /> - 배경에 이미지 표시
.NET프로그래밍/Silverlight 3.0 2009. 11. 27. 09:20 |
--> 아래그림과 같이 '솔루션 탐색기'에서 "images"폴더를 생성하고 "images"폴더안에 '이미지 파일'인 "silverlight.png"를 추가한다. 그리고 다시 '솔루션 탐색기'에서 "images"폴더를 복사하여 아래쪽에 있는 "ClientBin"폴더에도 "images"폴더를 붙여넣기한다.(기본적으로 "ClientBin"폴더에 "이미지 파일"이 있어야 정상적으로 실행할 수 있다.)
[FrmImageBrush.xaml]
<UserControl x:Class="RiaBrush.FrmImageBrush"
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">
<Ellipse Width="50" Height="50" Stroke="Red" StrokeThickness="1">
<Ellipse.Fill>
<ImageBrush ImageSource="images/silverlight.png"></ImageBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
</UserControl>
-------------------------------------------------------------------------------------
[실행결과]
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
Transforms 요소 - <TranslateTransform /> : 개체의 위치 이동 (0) | 2009.11.27 |
---|---|
<VideoBrush /> - 배경으로 비디오 표시 (0) | 2009.11.27 |
<RadialGradientBrush /> - 원 모양의 그라데이션 효과 (0) | 2009.11.27 |
<LinearGradientBrush /> - 두 점 사이에 선분을 만들어 그라데이션 효과 부여 (0) | 2009.11.27 |
Brush(브러시 - Shape 내부 채우기) - <SolidColorBrush /> : 단색을 채워주는 역할을 한다. (0) | 2009.11.27 |