TextDecorationUnit 列舉

定義

指定 TextDecorationPenOffsetPen 粗細值的單位類型。

C#
public enum TextDecorationUnit
繼承
TextDecorationUnit

欄位

FontRecommended 0

TextDecoration 使用的字型相對的單位值。 如果裝飾跨越多種字型,則會計算平均建議值。 這是預設值。

FontRenderingEmSize 1

與字型 em 大小相對的單位值。 位移或粗細值等於位移或粗細值乘以字型 em 大小。

Pixel 2

以像素表示的單位值。

範例

下列範例示範如何將 屬性設定 PenThicknessUnit 為 Pixel。

C#
// Move the text decoration lower using pixel value units.
myUnderline.PenOffset = 2;
myUnderline.PenOffsetUnit = TextDecorationUnit.Pixel;
myUnderline.PenThicknessUnit = TextDecorationUnit.Pixel;
XAML
<!-- Move the text decoration lower using pixel value units. -->
<TextDecoration PenOffset="2" PenOffsetUnit="Pixel" PenThicknessUnit="Pixel" />

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7