These properties are used to hold the current graphics control parameters. The following parameters can be modified using the GraphicProperties:
IsFilled: Specifies whether content elements should be filled.
IsStroked: Specified whether content elements should be stroked.
FillColor: The color which will be used to fill the content elements.
StrokeColor: The color which will be used to stroke the content elements.
StrokeThickness: The width of the stroke outline of content elements.
MiterLimit: Specifies the miter limit for graphic elements.
StrokeDashOffset: The dash array for graphic elements.
StrokeDashArray: The stroke dash array for graphic elements.
StrokeLineJoin: The stroke line join for graphic elements.
StrokeLineCap: The stroke line cap for graphic elements.
These properties hold the parameters used for text fragments. The following parameters can be modified using the TextProperties:
UnderlinePattern: The underline pattern. Two patterns are supported.
None: There is no underline. This is the default value.
- Single: The underline is a single line.
- None: There is no underline. This is the default value.
CharacterSpacing: The character spacing for text fragments.
WordSpacing: The word spacing for text fragments.
HorizontalScaling: The horizontal scaling for text fragments.
FontSize: The font size for text fragments.
RenderingMode: The rendering mode for text fragments.
BaselineAlignment: Describes how the baseline for a text-based element is positioned on the vertical axis, relative to the established baseline for text.
- Baseline: A baseline that is aligned at the actual baseline of the containing box.
- Subscript: A baseline that is aligned at the subscript position of the containing box.
- Superscript: A baseline that is aligned at the superscript position of the containing box.
Font: The font for the inserted text.
HorizontalAlignment: The horizontal positioning of the inserted text in the text block.
VerticalAlignment: The vertical positioning of the inserted text in the text block.
The TextProperties also exposes the following methods, which can be used for changing the current font:
TextProperties.TrySetFont(fontFamily, fontStyle, fontWeight);
Both Text and Graphic properties contain methods that can preserve and restore the current state.
The Save() method returns IDisposable object that will execute Restore() as soon as the dispose method is called and can be used in a using statement.