FormattedText 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 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)
初始化一個新的類別實例 FormattedText ,包含指定的文字、文化、流向、字體、字體大小、前景筆刷及 pixelsPerDip 值。
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 measure),以裝置無關單位(每單位1/96英吋)提供。
- foreground
- Brush
用來繪製每個符文的畫筆。
- pixelsPerDip
- Double
像素密度與解析度無關值,相當於比例因子。 例如,若螢幕的 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 measure),以裝置無關單位(每單位1/96英吋)提供。
- foreground
- Brush
用來繪製每個符文的畫筆。
- numberSubstitution
- NumberSubstitution
數字替換行為應用於文本。
- 屬性
適用於
FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, Double)
初始化一個新的類別實例 FormattedText ,使用指定的文字、文化、流向、字體、字體大小、前景筆刷、數字替換行為及 pixelsPerDip 值。
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 measure),以裝置無關單位(每單位1/96英吋)提供。
- foreground
- Brush
用來繪製每個符文的畫筆。
- numberSubstitution
- NumberSubstitution
指定文字中數字的顯示方式,基於 NumberSubstitution。 這個值可以是 null。
- pixelsPerDip
- Double
像素密度與解析度無關值,相當於比例因子。 例如,若螢幕的 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 measure),以裝置無關單位(每單位1/96英吋)提供。
- foreground
- Brush
用來繪製每個符文的畫筆。
- numberSubstitution
- NumberSubstitution
數字替換行為應用於文本。
- textFormattingMode
- TextFormattingMode
TextFormattingMode這些應用於文本。
- 屬性
適用於
FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode, Double)
初始化一個新的類別實例 FormattedText ,使用指定的文字、文化、流向、字體、字體大小、前景筆刷、數字替換行為及 pixelsPerDip 值。
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 measure),以裝置無關單位(每單位1/96英吋)提供。
- foreground
- Brush
他用刷子畫出每個符文。
- numberSubstitution
- NumberSubstitution
指定文字中數字的顯示方式,基於 NumberSubstitution。 這個值可以是 null。
- textFormattingMode
- TextFormattingMode
影響 WPF 顯示文字的格式模式。
- pixelsPerDip
- Double
像素密度與解析度無關值,相當於比例因子。 例如,若螢幕的 DPI 為 120(或 1.25,因為 120/96 = 1.25),則每個與密度無關的像素會繪製 1.25 像素。 DIP 是 WPF 用來獨立於裝置解析度與 DPI 的單位。