[]
Represents a graphics object that can be used to draw on a PDF page.
The origin (0,0) is in the top left corner of the page, the axis go right and down.
All coordinates and sizes are expressed in printer points (1/72 of an inch) by default. This can be changed using the Resolution property.
public class GcPdfGraphics : GcGraphics, IDisposable
Gets the size of the drawing area.
public SizeF CanvasSize { get; }
Gets the GcPdfDocument object owning this graphics.
public GcPdfDocument Doc { get; }
public override GcGraphicsFeatures Features { get; }
public override bool ImageCanBeDisposedAfterDrawing { get; }
Gets the resolution of the current graphics.
public override float Resolution { get; set; }
Gets or sets the SoftMaskBase object defining current Soft Mask.
public SoftMaskBase SoftMask { get; set; }
Gets or sets an ITextLayoutHandler object which will receive notifications from the GcPdfGraphics when TextLayout is rendered.
public ITextLayoutHandler TextLayoutHandler { get; set; }
Gets or sets the current transformation matrix. The default is Identity matrix.
public override Matrix3x2 Transform { get; set; }
Begins rendering to the specified layer
.
That layer should already exist in the Groups
collection of the current document's OptionalContent.
The EndLayer() method must be called to end rendering to the specified layer.
public void BeginLayer(OptionalContentGroup layer)
layer
OptionalContentGroupThe OptionalContentGroup that defines the target layer.
Begins rendering to the specified layer
.
The EndLayer() method must be called to end rendering to the specified layer.
public void BeginLayer(OptionalContentMembership layer)
layer
OptionalContentMembershipThe OptionalContentMembership that defines the target layer.
Begins rendering to a layer specified by layerName
.
That name should match the Name of an existing
OptionalContentGroup in the Groups
collection of the current document's OptionalContent.
The EndLayer() method must be called to end rendering to the specified layer.
public void BeginLayer(string layerName)
layerName
stringThe name of the target layer.
Begins Marked Content. Writes (BMC or BDC) operator to content stream, each call of BeginMarkedContent(string) should be enclosed with EndMarkedContent().
public void BeginMarkedContent(TagBase tag)
tag
TagBaseThe TagBase object indicating the role or significance of the marked-content element to the processing application.
Begins Marked Content. Writes (BMC or BDC) operator to content stream, each call of BeginMarkedContent(string) should be enclosed with EndMarkedContent().
public void BeginMarkedContent(string markedContentTag)
markedContentTag
stringThe tag indicating the role or significance of the marked-content element to the processing application.
public override void Composite(IGcTransparencyGroup srcLayer, Rectangle srcBounds, Point dstPoint, float? alpha)
srcLayer
GrapeCity.Documents.Drawing.IGcTransparencyGroupsrcBounds
System.Drawing.RectangledstPoint
System.Drawing.Pointalpha
float?public override IGcTransparencyGroup CreateTransparencyGroup(Rectangle size, bool isolated, bool knockout, bool softMask)
size
System.Drawing.Rectangleisolated
boolknockout
boolsoftMask
boolpublic override object CreateTransparencyMask(IGcTransparencyGroup layer, TransparencyMaskType maskType, Rectangle maskBounds)
layer
GrapeCity.Documents.Drawing.IGcTransparencyGroupmaskType
GrapeCity.Documents.Drawing.TransparencyMaskTypemaskBounds
System.Drawing.RectangleDisposes the current graphics.
protected override void Dispose(bool disposing)
disposing
boolDraws a FormXObject using specified bounds and image alignment.
The output parameter imageBounds
receives
the actual bounds of the drawn object(s).
public void DrawForm(FormXObject fxo, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align, out RectangleF[] imageBounds)
fxo
FormXObjectThe FormXObject to draw.
destBounds
System.Drawing.RectangleFThe destination rectangle.
clipBounds
System.Drawing.RectangleF?The clipping rectangle, or null for no clipping.
align
ImageAlignThe image alignment.
imageBounds
System.Drawing.RectangleF[]OUT: The actual bounds of the drawn image(s) (can be more than one if the image is tiled).
Draws a FormXObject using specified bounds and image alignment.
public void DrawForm(FormXObject fxo, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align)
fxo
FormXObjectThe FormXObject to draw.
destBounds
System.Drawing.RectangleFThe destination rectangle.
clipBounds
System.Drawing.RectangleF?The clipping rectangle, or null for no clipping.
align
ImageAlignThe image alignment.
For internal use only.
public override void DrawGlyphs(Font font, ushort[] glyphs, float[] glyphAdvances, string[] glyphUtf16, int length, Color color, Matrix3x2 matrix)
font
Fontglyphs
ushort[]glyphAdvances
float[]glyphUtf16
string[]length
intcolor
System.Drawing.Colormatrix
System.Numerics.Matrix3x2For internal use only.
public override void DrawVertGlyphs(Font font, ushort[] glyphs, float[] glyphAdvances, float[] glyphVx, float[] glyphVy, string[] glyphUtf16, int length, Color color, Matrix3x2 matrix)
font
Fontglyphs
ushort[]glyphAdvances
float[]glyphVx
float[]glyphVy
float[]glyphUtf16
string[]length
intcolor
System.Drawing.Colormatrix
System.Numerics.Matrix3x2Ends rendering to the layer specified by a previous call to BeginLayer(string), BeginLayer(OptionalContentGroup) or BeginLayer(OptionalContentMembership).
public void EndLayer()
Ends Marked Content. Writes EMC operator to content stream.
public void EndMarkedContent()
For internal use. Returns the current blend mode.
protected override BlendMode GetBlendMode()
For internal use.
protected override IClipRegion InternalCreateClipRegion(IPath graphicsPath)
graphicsPath
IPathFor internal use.
protected override IClipRegion InternalCreateClipRegion(RectangleF bounds)
bounds
System.Drawing.RectangleFFor internal use.
protected override IPath InternalCreatePath()
For internal use.
protected override void InternalDrawEllipse(RectangleF bounds, Pen pen)
bounds
System.Drawing.RectangleFpen
PenFor internal use.
protected override void InternalDrawImage(RectangleF dstRect, IImage image, float opacity)
dstRect
System.Drawing.RectangleFimage
IImageopacity
floatFor internal use.
protected override void InternalDrawLine(PointF p1, PointF p2, Pen pen)
p1
System.Drawing.PointFp2
System.Drawing.PointFpen
PenFor internal use.
protected override void InternalDrawLines(PointF[] points, Pen pen)
points
System.Drawing.PointF[]pen
PenFor internal use.
protected override void InternalDrawPath(IPath path, Pen pen)
For internal use.
protected override void InternalDrawPolygon(PointF[] points, Pen pen)
points
System.Drawing.PointF[]pen
PenFor internal use.
protected override void InternalDrawRectangle(RectangleF bounds, Pen pen)
bounds
System.Drawing.RectangleFpen
PenFor internal use.
protected override void InternalDrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Pen pen)
bounds
System.Drawing.RectangleFradiusX
floatradiusY
floatpen
PenFor internal use.
protected override void InternalDrawTextLayout(TextLayout textLayout, PointF location)
textLayout
TextLayoutlocation
System.Drawing.PointFFor internal use.
protected override void InternalFillEllipse(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
bounds
System.Drawing.RectangleFbrush
BrushbrushBounds
System.Drawing.RectangleF?brushTransform
System.Numerics.Matrix3x2?For internal use.
protected override void InternalFillEllipse(RectangleF bounds, Color color)
bounds
System.Drawing.RectangleFcolor
System.Drawing.ColorFor internal use.
protected override void InternalFillPath(IPath path, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
path
IPathbrush
BrushbrushBounds
System.Drawing.RectangleF?brushTransform
System.Numerics.Matrix3x2?For internal use.
protected override void InternalFillPath(IPath path, Color color)
path
IPathcolor
System.Drawing.ColorFor internal use.
protected override void InternalFillPolygon(PointF[] points, Brush brush, FillMode fillMode, RectangleF? brushBounds, Matrix3x2? brushTransform)
points
System.Drawing.PointF[]brush
BrushfillMode
FillModebrushBounds
System.Drawing.RectangleF?brushTransform
System.Numerics.Matrix3x2?For internal use.
protected override void InternalFillPolygon(PointF[] points, Color color, FillMode fillMode)
points
System.Drawing.PointF[]color
System.Drawing.ColorfillMode
FillModeFor internal use.
protected override void InternalFillRectangle(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
bounds
System.Drawing.RectangleFbrush
BrushbrushBounds
System.Drawing.RectangleF?brushTransform
System.Numerics.Matrix3x2?For internal use.
protected override void InternalFillRectangle(RectangleF bounds, Color color)
bounds
System.Drawing.RectangleFcolor
System.Drawing.ColorFor internal use.
protected override void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)
bounds
System.Drawing.RectangleFradiusX
floatradiusY
floatbrush
BrushbrushBounds
System.Drawing.RectangleF?brushTransform
System.Numerics.Matrix3x2?For internal use.
protected override void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Color color)
bounds
System.Drawing.RectangleFradiusX
floatradiusY
floatcolor
System.Drawing.ColorFor internal use.
protected override void InternalRemoveClip(IClipRegion clipRegion)
clipRegion
IClipRegionFor internal use.
protected override void InternalSetClip(IClipRegion clipRegion)
clipRegion
IClipRegionIndicates whether this graphics implementation supports a specified blend mode.
The following blend modes are supported by GcPdfGraphics:
public override bool IsBlendModeSupported(BlendMode blendMode)
blendMode
BlendModeThe blend mode to check.
true if the specified blend mode is supported by the current graphics, false otherwise.
Indicates whether this graphics implementation supports a specified interpolation mode.
NearestNeighbor is the only interpolation mode supported by GcPdfGraphics.
public override bool IsInterpolationModeSupported(InterpolationMode interpolationMode)
interpolationMode
InterpolationModeThe interpolation mode to check.
true if the specified interpolation mode is supported by the current graphics, false otherwise.
Stops redirecting drawing operations to the transparency layer that was created by the last PushTransparencyLayer(RectangleF?, float) call.
public override void PopTransparencyLayer()
Adds a transparency layer to the GcPdfGraphics so that it receives all subsequent drawing operations until PopTransparencyLayer() is called.
public override void PushTransparencyLayer(RectangleF? contentBounds, float opacity)
contentBounds
System.Drawing.RectangleF?The content bounds of the transparency layer. Content won't render outside these bounds. When set to null, the content bounds are effectively taken to be the bounds of the current GcPdfGraphics.
opacity
floatAn opacity value that is applied uniformly to all drawings in the layer when compositing to the backplate.
For internal use. Sets the current blend mode.
protected override void SetBlendMode(BlendMode value)
value
BlendModepublic override void SetTransparencyMask(object nativeMask)
nativeMask
object