FormattedText 构造函数

定义

初始化 FormattedText 类的新实例。

重载

名称 说明
FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush)
已过时.

使用指定的文本、区域性、流方向、字样、字号和画笔初始化类的新实例 FormattedText

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

使用指定的文本、区域性、流方向、字样、字号、前景色画笔和像素PerDip 值初始化类的新实例 FormattedText

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution)
已过时.

使用指定的文本、区域性、流方向、字样、字号、画笔和数字替换行为初始化类的新实例 FormattedText

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

使用指定的文本、区域性、流方向、字样、字号、前景画笔、数字替换行为和像素PerDip 值初始化类的新实例 FormattedText

FormattedText(String, CultureInfo, FlowDirection, Typeface, Double, Brush, NumberSubstitution, TextFormattingMode)
已过时.

使用指定的文本、区域性、流方向、字样、字号、画笔、数字替换行为和文本格式模式初始化类的新实例 FormattedText

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

使用指定的文本、区域性、流方向、字样、字号、前景画笔、数字替换行为和像素PerDip 值初始化类的新实例 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)

使用指定的文本、区域性、流方向、字样、字号、前景色画笔和像素PerDip 值初始化类的新实例 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

像素每密度独立像素值,该值相当于刻度因子。 例如,如果屏幕的 DPI 为 120(或 1.25,因为 120/96 = 1.25),则绘制每个密度无关像素的 1.25 像素。 DIP 是WPF用于独立于设备分辨率和 DPIs 的度量单位。

适用于

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)

使用指定的文本、区域性、流方向、字样、字号、前景画笔、数字替换行为和像素PerDip 值初始化类的新实例 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

像素每密度独立像素值,该值相当于刻度因子。 例如,如果屏幕的 DPI 为 120(或 1.25,因为 120/96 = 1.25),则绘制每个密度无关像素的 1.25 像素。 DIP 是WPF用于独立于设备分辨率和 DPIs 的度量单位。

适用于

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)

使用指定的文本、区域性、流方向、字样、字号、前景画笔、数字替换行为和像素PerDip 值初始化类的新实例 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

像素每密度独立像素值,该值相当于刻度因子。 例如,如果屏幕的 DPI 为 120(或 1.25,因为 120/96 = 1.25),则绘制每个密度无关像素的 1.25 像素。 DIP 是WPF用于独立于设备分辨率和 DPIs 的度量单位。

适用于