728x90
반응형
728x170
■ DrawingImage 엘리먼트에서 DrawingGroup 객체를 사용해 이미지를 만드는 방법을 보여준다.
▶ MainWindow.xaml
<Window x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
Height="600"
Title="DrawingImage 엘리먼트 : DrawingGroup 객체를 사용해 이미지 만들기"
FontFamily="나눔고딕코딩"
FontSize="16">
<Grid>
<Image Stretch="None">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup>
<ImageDrawing
Rect="0 50 200 250"
ImageSource="IMAGE/sample.jpg" />
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen
Brush="RoyalBlue"
Thickness="5" />
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="2.5 52.5 195 245" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen
Brush="Blue"
Thickness="5" />
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0 50 200 250" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Geometry="M 0 50 L 100 0 L 200 50" >
<GeometryDrawing.Pen>
<Pen
Brush="Blue"
Thickness="5" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Grid>
</Window>
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] ControlTemplate 엘리먼트 : 아이콘 헤더 TabItem 엘리먼트 정의하기 (0) | 2020.09.11 |
---|---|
[C#/WPF] DrawingContext 클래스 : DrawRoundedRectangle 메소드를 사용해 라운드 사각형 그리기 (0) | 2020.09.11 |
[C#/WPF] DrawingContext 클래스 : DrawRectangle 메소드를 사용해 사각형 그리기 (0) | 2020.09.11 |
[C#/WPF] Window 엘리먼트 : 테두리 없는 윈도우 그림자 효과 사용하기 (0) | 2020.09.11 |
[C#/WPF] DrawingGroup 엘리먼트 : Transform 속성 사용하기 (0) | 2020.09.11 |
[C#/WPF] ListBox 엘리먼트 : AlternationConverter 객체를 사용해 그룹 항목 배경색/전경색 설정하기 (0) | 2020.09.10 |
[C#/WPF] ListBox 엘리먼트 : AlternationConverter 객체를 사용해 리스트 박스 항목 배경색/전경색 설정하기 (0) | 2020.09.10 |
[C#/WPF] ListBox 엘리먼트 : AlternationIndex 첨부 속성을 사용해 리스트 박스 항목 배경색/전경색 설정하기 (0) | 2020.09.10 |
[C#/WPF] Button 엘리먼트 : ClickMode 속성 사용하기 (0) | 2020.09.10 |
[C#/WPF] AnimationClock 클래스 : 클럭 컨트롤러 사용하기 (0) | 2020.09.09 |
댓글을 달아 주세요