MinMaxParagraphWidth Struct
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Vertegenwoordigt de kleinste en grootst mogelijke alineabreedte die de opgegeven tekstinhoud volledig kan bevatten.
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)
- Overname
- Implementeringen
Voorbeelden
In het volgende voorbeeld ziet u hoe u de MinWidth eigenschap gebruikt om de minimale alineabreedte te genereren voor de opgemaakte regels tekst.
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
Eigenschappen
| Name | Description |
|---|---|
| MaxWidth |
Hiermee haalt u de grootste alineabreedte op die de opgegeven tekstinhoud volledig kan bevatten. |
| MinWidth |
Hiermee haalt u de kleinste alineabreedte op die de opgegeven tekstinhoud volledig kan bevatten. |
Methoden
| Name | Description |
|---|---|
| Equals(MinMaxParagraphWidth) |
Bepaalt of het CharacterBufferReference gelijk is aan het huidige CharacterBufferReference object. |
| Equals(Object) |
Bepaalt of het opgegeven object gelijk is aan het huidige CharacterBufferReference object. |
| GetHashCode() |
Fungeert als een hash-functie voor CharacterBufferReference. Het is geschikt voor gebruik in hash-algoritmen en gegevensstructuren, zoals een hash-tabel. |
Operators
| Name | Description |
|---|---|
| Equality(MinMaxParagraphWidth, MinMaxParagraphWidth) |
Vergelijk twee CharacterBufferReference tekenreeksen voor gelijkheid. |
| Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth) |
Vergelijk twee CharacterBufferReference objecten voor ongelijkheid. |