WPF 글꼴 이나 내용 이 모호 한 해결 방법
1.WPF 4.0 의 새 글꼴 렌 더 링 방법 으로 개선 되 지 않 음
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
<Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
2.컨트롤 에 SnapToDevicePixels 속성 을 추가 하여 개선 되 지 않 음UI 전체 에 픽 셀 정렬 을 사용 한 다 는 전설 이 있 습 니 다.
96 dots per inch (dpi)
이상 의 장 치 를 운행 하 는 경우 픽 셀 정렬 은 단일 실선 부근 에 나타 나 는 톱날 의 시각 적 하 자 를 최소 화 할 수 있 습 니 다.3.Times New Roman 글꼴 이나 마이크로소프트 검은색 글꼴 을 사용 하 는 것 이 좋 습 니 다.그러나 글씨체 가 못 생 겨 서 허 황 된 것 을 완전히 피 할 수 없습니다.또한 애니메이션 을 해결 하지 못 한 후에 문자 가 계속 허 변 현상 을 해결 할 수 없습니다.
4.최종 해결
사실은 자신 이 작성 한
Border
에 DropShadowEffect
(그림자 효과)을 설정 해서 생 긴 것 입 니 다.DropShadowEffect
으로 인해 요소/하위 요 소 를 비트 맵 으로 먼저 렌 더 링 하여 비트 맵 격자 정렬 으로 인 한 모호 함.해결 방법 은 몇 가지 가 있다.
UseLayoutRounding
을 사용 하여 컨트롤 을 배치 할 때 격자 를 맞 춥 니 다(효과 2 참조).DropShadowEffect
의 서브 요소 로 하지 않 고 ShadowEffect
이 Button
에 영향 을 주지 않도록 하 는 것 이다(효과 3 참조).효과 4 는 System DropShadow Chrome 을 시험 하여 주석 을 달 수 있 습 니 다.
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:luna="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna"
Title="MainWindow" Height="350" Width="525" SnapsToDevicePixels="True">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="80" />
<Setter Property="Height" Value="40" />
<Setter Property="Margin" Value="0,5,0,5" />
</Style>
</Window.Resources>
<StackPanel>
<Button Content=" 0" />
<Button Content=" 1" >
<Button.Effect><DropShadowEffect/></Button.Effect>
</Button>
<Button Content=" 2" UseLayoutRounding="True">
<Button.Effect>
<DropShadowEffect/>
</Button.Effect>
</Button>
<Grid Width="80" Height="40" Margin="0,5,0,5">
<Border Background="Black" Margin="1,0,0,0" CornerRadius="2">
<Border.Effect><DropShadowEffect /></Border.Effect>
</Border>
<Button Content=" 3" Margin="0"/>
</Grid>
<luna:SystemDropShadowChrome Width="80" Height="40" Margin="0,5,0,0">
<Button Content=" 4" Margin="0" />
</luna:SystemDropShadowChrome>
</StackPanel>
</Window>
총결산이상 은 이 글 의 전체 내용 입 니 다.본 논문 의 내용 이 여러분 의 학습 이나 업무 에 어느 정도 도움 이 되 기 를 바 랍 니 다.궁금 한 점 이 있 으 면 댓 글 을 남 겨 주 십시오.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
WPF RelativeSources 2022에 대한 간단한 가이드 | 아이포 테크노랩WPF RelativeSource는 해당 관계를 사용하여 요소의 데이터를 다른 소스 요소와 바인딩하는 데 도움이 되는 마크업 확장입니다. 다른 객체의 속성이나 상대 부모에 대한 모든 객체의 Bindings 속성과 함...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.