Class RecordingGraphics
A Graphics surface that records drawing operations into a VectorScene instead of rasterizing. Same public API as Graphics. Reuses all convenience overloads unchanged; only primitives and state hooks are intercepted.
Implements
Inherited Members
Namespace: DRIT.Drawing
Assembly: DRIT.Drawing.dll
Syntax
public sealed class RecordingGraphics : Graphics, IDisposable
Properties
DpiX
Gets the horizontal resolution of the graphics context in pixels per inch.
Declaration
public override float DpiX { get; }
Property Value
| Type | Description |
|---|---|
| float |
Overrides
DpiY
Gets the vertical resolution of the graphics context in pixels per inch.
Declaration
public override float DpiY { get; }
Property Value
| Type | Description |
|---|---|
| float |
Overrides
Height
Gets the height of the drawing surface in pixels.
Declaration
public override int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
IsRecording
Gets a value indicating whether this graphics surface is a recording (non-raster) surface. When true, DRIT.Drawing.Graphics._target is null and raster core methods are never called.
Declaration
protected override bool IsRecording { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Width
Gets the width of the drawing surface in pixels.
Declaration
public override int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Methods
ClearCore(Color)
Core implementation that clears the surface. Override in a recording surface to capture the command instead of rasterizing.
Declaration
protected override void ClearCore(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color |
Overrides
DrawImageCore(Image, PointF[], RectangleF, GraphicsUnit, ImageAttributes?)
Core implementation that draws an affine-transformed image. Override in a recording surface to capture the command instead of rasterizing.
Declaration
protected override void DrawImageCore(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes? attr)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | image | |
| PointF[] | destPoints | |
| RectangleF | srcRect | |
| GraphicsUnit | srcUnit | |
| ImageAttributes | attr |
Overrides
DrawImageCore(Image, RectangleF, RectangleF, GraphicsUnit, ImageAttributes?)
Core implementation that draws a scaled image. Override in a recording surface to capture the command instead of rasterizing.
Declaration
protected override void DrawImageCore(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes? attr)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | image | |
| RectangleF | destRect | |
| RectangleF | srcRect | |
| GraphicsUnit | srcUnit | |
| ImageAttributes | attr |
Overrides
DrawPathCore(Pen, GraphicsPath)
Core implementation that strokes a graphics path. Override in a recording surface to capture the command instead of rasterizing.
Declaration
protected override void DrawPathCore(Pen pen, GraphicsPath path)
Parameters
| Type | Name | Description |
|---|---|---|
| Pen | pen | The pen to stroke with. |
| GraphicsPath | path | The path to stroke. |
Overrides
DrawStringCore(string, Font, Brush, RectangleF, StringFormat?)
Draws text using the supplied string, font, brush, and layout rectangle.
Declaration
protected override void DrawStringCore(string s, Font font, Brush brush, RectangleF layoutRect, StringFormat? format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | s | |
| Font | font | |
| Brush | brush | |
| RectangleF | layoutRect | |
| StringFormat | format |
Overrides
FillPathCore(Brush, GraphicsPath, FillMode)
Core implementation that fills a graphics path. Override in a recording surface to capture the command instead of rasterizing.
Declaration
protected override void FillPathCore(Brush brush, GraphicsPath path, FillMode fillMode)
Parameters
| Type | Name | Description |
|---|---|---|
| Brush | brush | |
| GraphicsPath | path | |
| FillMode | fillMode |
Overrides
OnClipChanged()
Called after the clip region changes. Override in a recording surface to capture the new clip state.
Declaration
protected override void OnClipChanged()
Overrides
OnHintChanged(object)
Called after a rendering hint, page unit, page scale, or rendering origin changes. Override in a recording surface to capture the new value.
Declaration
protected override void OnHintChanged(object hintValue)
Parameters
| Type | Name | Description |
|---|---|---|
| object | hintValue | The new hint value. |
Overrides
OnTransformChanged()
Called after the world transform changes. Override in a recording surface to capture the new transform state.
Declaration
protected override void OnTransformChanged()
Overrides
Restore(GraphicsState)
Restores the graphics state to the specified state.
Declaration
public override void Restore(GraphicsState graphicsState)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphicsState | graphicsState | The graphics state to restore. |
Overrides
Save()
Saves the current graphics state and returns a GraphicsState object.
Declaration
public override GraphicsState Save()
Returns
| Type | Description |
|---|---|
| GraphicsState | The saved graphics state. |