728x90
반응형
728x170
■ GlyphRunDrawing 엘리먼트의 GlyphRun 속성을 사용해 텍스트를 그리는 방법을 보여준다.
▶ 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="TestProject"
FontFamily="나눔고딕코딩"
FontSize="16">
<Rectangle
Width="500"
Height="100">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<GlyphRunDrawing ForegroundBrush="Black">
<GlyphRunDrawing.GlyphRun>
<GlyphRun
CaretStops="{x:Null}"
ClusterMap="{x:Null}"
IsSideways="False"
GlyphOffsets="{x:Null}"
GlyphIndices="43 72 79 79 82 3 58 82 85 79 71"
BaselineOrigin="0 12.29"
FontRenderingEmSize="13.333333333333334"
DeviceFontName="{x:Null}"
AdvanceWidths="9.62666666666667 7.41333333333333 2.96 2.96 7.41333333333333 3.70666666666667 12.5866666666667 7.41333333333333 4.44 2.96 7.41333333333333"
BidiLevel="0">
<GlyphRun.GlyphTypeface>
<GlyphTypeface FontUri="C:\WINDOWS\Fonts\TIMES.TTF" />
</GlyphRun.GlyphTypeface>
</GlyphRun>
</GlyphRunDrawing.GlyphRun>
</GlyphRunDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Window>
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] ImageDrawing 엘리먼트 : Rect/ImageSource 속성을 사용해 이미지 드로잉 그리기 (0) | 2023.03.26 |
---|---|
[C#/WPF] DrawingGroup 엘리먼트 : BitmapEffect/OpacityMask 속성을 사용해 드로잉 그리기 (0) | 2023.03.26 |
[C#/WPF] DrawingGroup 엘리먼트 : 합성 드로잉 그리기 (0) | 2023.03.26 |
[C#/WPF] DrawingGroup 엘리먼트 : GuidelineSet 객체를 설정해 드로잉 만들기 (0) | 2023.03.26 |
[C#/WPF] DrawingGroup 클래스 : GuidelineSet 객체를 설정해 드로잉 만들기 (0) | 2023.03.26 |
[C#/WPF] VideoDrawing 엘리먼트 : MediaTimeline/MediaClock 객체를 사용해 무한 반복하는 동영상 재생하기 (0) | 2023.03.25 |
[C#/WPF] VideoDrawing 엘리먼트 : 동영상 재생하기 (0) | 2023.03.24 |
[C#/WPF] GeometryDrawing 엘리먼트 사용하기 (0) | 2023.03.24 |
[C#/WPF] ImageBrush 엘리먼트 : Transform/RelativeTransform 속성을 사용해 이미지 브러시 만들기 (0) | 2023.03.24 |
[C#/WPF] DrawingBrush 엘리먼트 : AlignmentX/AlignmentY 속성을 사용해 드로잉 브러시 만들기 (0) | 2023.03.24 |
댓글을 달아 주세요