MinMaxParagraphWidth Struktura
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Představuje nejmenší a největší možnou šířku odstavce, která může plně obsahovat zadaný textový obsah.
public value class MinMaxParagraphWidth : IEquatable<System::Windows::Media::TextFormatting::MinMaxParagraphWidth>
public struct MinMaxParagraphWidth : IEquatable<System.Windows.Media.TextFormatting.MinMaxParagraphWidth>
type MinMaxParagraphWidth = struct
Public Structure MinMaxParagraphWidth
Implements IEquatable(Of MinMaxParagraphWidth)
- Dědičnost
- Implementuje
Příklady
Následující příklad ukazuje, jak pomocí MinWidth vlastnosti vygenerovat minimální šířku odstavce pro formátované řádky textu.
MinMaxParagraphWidth minMaxParaWidth =
formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties);
// Format each line of text from the text store and draw it.
while (textStorePosition < customTextSource.Text.Length)
{
// Create a textline from the text store using the TextFormatter object.
using (TextLine myTextLine = formatter.FormatLine(
customTextSource,
textStorePosition,
minMaxParaWidth.MinWidth,
customTextParagraphProperties,
null))
{
// Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, linePosition, InvertAxes.None);
// Update the index position in the text store.
textStorePosition += myTextLine.Length;
// Update the line position coordinate for the displayed line.
linePosition.Y += myTextLine.Height;
}
}
Dim minMaxParaWidth As MinMaxParagraphWidth = formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties)
' Format each line of text from the text store and draw it.
Do While textStorePosition < customTextSource.Text.Length
' Create a textline from the text store using the TextFormatter object.
Using myTextLine As TextLine = formatter.FormatLine(customTextSource, textStorePosition, minMaxParaWidth.MinWidth, customTextParagraphProperties, Nothing)
' Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, linePosition, InvertAxes.None)
' Update the index position in the text store.
textStorePosition += myTextLine.Length
' Update the line position coordinate for the displayed line.
linePosition.Y += myTextLine.Height
End Using
Loop
Vlastnosti
| Name | Description |
|---|---|
| MaxWidth |
Získá největší možnou šířku odstavce, která může plně obsahovat zadaný textový obsah. |
| MinWidth |
Získá nejmenší možnou šířku odstavce, která může plně obsahovat zadaný textový obsah. |
Metody
| Name | Description |
|---|---|
| Equals(MinMaxParagraphWidth) |
Určuje, zda CharacterBufferReference je rovna aktuálnímu CharacterBufferReference objektu. |
| Equals(Object) |
Určuje, zda je zadaný objekt roven aktuálnímu CharacterBufferReference objektu. |
| GetHashCode() |
Slouží jako hashovací funkce pro CharacterBufferReference. Je vhodný pro použití v algoritmech hash a datových strukturách, jako je například hashovací tabulka. |
Operátory
| Name | Description |
|---|---|
| Equality(MinMaxParagraphWidth, MinMaxParagraphWidth) |
Porovnejte dva CharacterBufferReference řetězce rovnosti. |
| Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth) |
Porovnejte dva CharacterBufferReference objekty pro nerovnost. |