FormattedText 建構函式

定義

初始化 FormattedText 類別的新執行個體。

多載

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush)
已過時。

使用指定的文字、文化特性、流向、字樣、字型大小和筆刷,初始化 FormattedText 類別的新執行個體。

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, Double)

使用指定的文字、文化特性、流向、字樣、字型大小、前景筆刷和 pixelsPerDip 值,初始化 FormattedText 類別的新執行個體。

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution)
已過時。

初始化 FormattedText 類別的執行個體,這個執行個體具有指定的文字、文化特性、流程方向、字樣、字型大小、筆刷和數字取代行為。

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, Double)

使用指定的文字、文化特性、流向、字樣、字型大小、前景筆刷、數字取代行為和 pixelsPerDip 值,初始化 FormattedText 類別的新執行個體。

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode)
已過時。

使用指定的文字、文化特性、流程方向、字樣、字型大小、筆刷和數字替代行為和文字格式化模式,初始化 FormattedText 類別的新執行個體。

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode, Double)

使用指定的文字、文化特性、流向、字樣、字型大小、前景筆刷、數字取代行為和 pixelsPerDip 值,初始化 FormattedText 類別的新執行個體。

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush)

警告

Use the PixelsPerDip override

使用指定的文字、文化特性、流向、字樣、字型大小和筆刷,初始化 FormattedText 類別的新執行個體。

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground);
[System.Obsolete("Use the PixelsPerDip override", false)]
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush -> System.Windows.Media.FormattedText
[<System.Obsolete("Use the PixelsPerDip override", false)>]
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush)

參數

textToFormat
String

要顯示的文字。

culture
CultureInfo

文字的特定文化特性。

flowDirection
FlowDirection

文字的讀取方向。

typeface
Typeface

應該用來格式化文字的字型家族、粗細、樣式和自動縮放。

emSize
Double

應該用來格式化文字的字型大小。

foreground
Brush

用來繪製每個字符的筆刷。

屬性

適用於

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, Double)

使用指定的文字、文化特性、流向、字樣、字型大小、前景筆刷和 pixelsPerDip 值,初始化 FormattedText 類別的新執行個體。

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, double pixelsPerDip);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, double pixelsPerDip);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * double -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, pixelsPerDip As Double)

參數

textToFormat
String

要顯示的文字。

culture
CultureInfo

文字的特定文化特性。

flowDirection
FlowDirection

文字的讀取方向。

typeface
Typeface

應該用來格式化文字的字型家族、粗細、樣式和自動縮放。

emSize
Double

文字 em 量值的字型大小,以裝置獨立單位提供, (每單位 1/96 英吋) 。

foreground
Brush

用來繪製每個字符的筆刷。

pixelsPerDip
Double

「每一密度像素無關的像素 (Pixels Per Density Independent Pixel)」值,相當於縮放比例。 例如,如果螢幕的 DPI 是 120 (或 1.25,因為 120/96 = 1.25),則會繪製 1.25 倍的每一密度像素無關的像素。 DIP 是 WPF 使用的度量單位 (獨立於裝置解析度和 DPI 之外)。

適用於

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution)

警告

Use the PixelsPerDip override

初始化 FormattedText 類別的執行個體,這個執行個體具有指定的文字、文化特性、流程方向、字樣、字型大小、筆刷和數字取代行為。

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution);
[System.Obsolete("Use the PixelsPerDip override", false)]
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution -> System.Windows.Media.FormattedText
[<System.Obsolete("Use the PixelsPerDip override", false)>]
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution)

參數

textToFormat
String

要顯示的文字。

culture
CultureInfo

文字的特定文化特性。

flowDirection
FlowDirection

文字的讀取方向。

typeface
Typeface

應該用來格式化文字的字型家族、粗細、樣式和自動縮放。

emSize
Double

文字 em 量值的字型大小,以裝置獨立單位提供, (每單位 1/96 英吋) 。

foreground
Brush

用來繪製每個字符的筆刷。

numberSubstitution
NumberSubstitution

要套用至文字的數字取代行為。

屬性

適用於

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, Double)

使用指定的文字、文化特性、流向、字樣、字型大小、前景筆刷、數字取代行為和 pixelsPerDip 值,初始化 FormattedText 類別的新執行個體。

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution, double pixelsPerDip);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, double pixelsPerDip);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * double -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution, pixelsPerDip As Double)

參數

textToFormat
String

要顯示的文字。

culture
CultureInfo

文字的特定文化特性。

flowDirection
FlowDirection

文字的讀取方向。

typeface
Typeface

應該用來格式化文字的字型家族、粗細、樣式和自動縮放。

emSize
Double

文字 em 量值的字型大小,以裝置獨立單位提供, (每單位 1/96 英吋) 。

foreground
Brush

用來繪製每個字符的筆刷。

numberSubstitution
NumberSubstitution

根據 NumberSubstitution 指定文字中的數字顯示方式。 這個值可以是 null

pixelsPerDip
Double

「每一密度像素無關的像素 (Pixels Per Density Independent Pixel)」值,相當於縮放比例。 例如,如果螢幕的 DPI 是 120 (或 1.25,因為 120/96 = 1.25),則會繪製 1.25 倍的每一密度像素無關的像素。 DIP 是 WPF 使用的度量單位 (獨立於裝置解析度和 DPI 之外)。

適用於

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode)

警告

Use the PixelsPerDip override

使用指定的文字、文化特性、流程方向、字樣、字型大小、筆刷和數字替代行為和文字格式化模式,初始化 FormattedText 類別的新執行個體。

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution, System::Windows::Media::TextFormattingMode textFormattingMode);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, System.Windows.Media.TextFormattingMode textFormattingMode);
[System.Obsolete("Use the PixelsPerDip override", false)]
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, System.Windows.Media.TextFormattingMode textFormattingMode);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * System.Windows.Media.TextFormattingMode -> System.Windows.Media.FormattedText
[<System.Obsolete("Use the PixelsPerDip override", false)>]
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * System.Windows.Media.TextFormattingMode -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution, textFormattingMode As TextFormattingMode)

參數

textToFormat
String

要顯示的文字。

culture
CultureInfo

文字的特定文化特性。

flowDirection
FlowDirection

文字的讀取方向。

typeface
Typeface

應該用來格式化文字的字型家族、粗細、樣式和自動縮放。

emSize
Double

文字 em 量值的字型大小,以裝置獨立單位提供, (每單位 1/96 英吋) 。

foreground
Brush

用來繪製每個字符的筆刷。

numberSubstitution
NumberSubstitution

要套用至文字的數字取代行為。

textFormattingMode
TextFormattingMode

TextFormattingMode,要套用至文字。

屬性

適用於

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode, Double)

使用指定的文字、文化特性、流向、字樣、字型大小、前景筆刷、數字取代行為和 pixelsPerDip 值,初始化 FormattedText 類別的新執行個體。

public:
 FormattedText(System::String ^ textToFormat, System::Globalization::CultureInfo ^ culture, System::Windows::FlowDirection flowDirection, System::Windows::Media::Typeface ^ typeface, double emSize, System::Windows::Media::Brush ^ foreground, System::Windows::Media::NumberSubstitution ^ numberSubstitution, System::Windows::Media::TextFormattingMode textFormattingMode, double pixelsPerDip);
public FormattedText (string textToFormat, System.Globalization.CultureInfo culture, System.Windows.FlowDirection flowDirection, System.Windows.Media.Typeface typeface, double emSize, System.Windows.Media.Brush foreground, System.Windows.Media.NumberSubstitution numberSubstitution, System.Windows.Media.TextFormattingMode textFormattingMode, double pixelsPerDip);
new System.Windows.Media.FormattedText : string * System.Globalization.CultureInfo * System.Windows.FlowDirection * System.Windows.Media.Typeface * double * System.Windows.Media.Brush * System.Windows.Media.NumberSubstitution * System.Windows.Media.TextFormattingMode * double -> System.Windows.Media.FormattedText
Public Sub New (textToFormat As String, culture As CultureInfo, flowDirection As FlowDirection, typeface As Typeface, emSize As Double, foreground As Brush, numberSubstitution As NumberSubstitution, textFormattingMode As TextFormattingMode, pixelsPerDip As Double)

參數

textToFormat
String

要顯示的文字。

culture
CultureInfo

文字的特定文化特性。

flowDirection
FlowDirection

文字的讀取方向。

typeface
Typeface

應該用來格式化文字的字型家族、粗細、樣式和自動縮放。

emSize
Double

文字 em 量值的字型大小,以裝置獨立單位提供, (每單位 1/96 英吋) 。

foreground
Brush

用來繪製每個字符的筆刷。

numberSubstitution
NumberSubstitution

根據 NumberSubstitution 指定文字中的數字顯示方式。 這個值可以是 null

textFormattingMode
TextFormattingMode

影響 WPF 如何顯示文字的格式模式。

pixelsPerDip
Double

「每一密度像素無關的像素 (Pixels Per Density Independent Pixel)」值,相當於縮放比例。 例如,如果螢幕的 DPI 是 120 (或 1.25,因為 120/96 = 1.25),則會繪製 1.25 倍的每一密度像素無關的像素。 DIP 是 WPF 使用的度量單位 (獨立於裝置解析度和 DPI 之外)。

適用於