[]
        
(Showing Draft Content)

GrapeCity.Documents.Imaging.BitmapRenderer

Class BitmapRenderer

Namespace
GrapeCity.Documents.Imaging
Assembly
GcDocs.Imaging.dll

Provides methods for drawing on a GcBitmap.

public class BitmapRenderer
Inheritance
object
BitmapRenderer
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

Aliased

Gets or sets a value indicating whether the graphic objects are drawn without anti-aliasing.

public bool Aliased { get; set; }

Property Value

bool

BackgroundBitmap

Gets or sets a bitmap providing background for all drawing and filling operations.

The same bitmap cannot be used as background and target at the same time.

The background bitmap must be of the same pixel size as the target bitmap.

public GcBitmap BackgroundBitmap { get; set; }

Property Value

GcBitmap

BackgroundBitmapContainsUnmodifiedImage

Gets or sets a value indicating that copying pixels from the BackgroundBitmap to the target bitmap should not be marked as changed in the UpdatedPixelMask.

The default is false, indicating that pixels copied from the background bitmap to the target are marked as changed.

public bool BackgroundBitmapContainsUnmodifiedImage { get; set; }

Property Value

bool

Bitmap

Gets the target bitmap.

public GcBitmap Bitmap { get; }

Property Value

GcBitmap

BlendMode

Gets or sets the method of mixing source and destination colors when drawing.

Default is Normal.

public BlendMode BlendMode { get; set; }

Property Value

BlendMode

ClipRect

Gets or sets a rectangle, in pixels, to which all subsequent drawing operations are clipped.

public Rectangle? ClipRect { get; set; }

Property Value

System.Drawing.Rectangle?

ClipRegion

Gets or sets a region to which the subsequient drawing operations are clipped.

public Region ClipRegion { get; set; }

Property Value

Region

ForceAntialiasingForText

Gets or sets a value specifying whether a TextLayout is always drawn with antialiasing regardless the value of the Aliased property.

public bool ForceAntialiasingForText { get; set; }

Property Value

bool

InterpolationMode

Gets or sets the sampling mode to use when drawing bitmaps with resizing.

Default is Linear.

public InterpolationMode InterpolationMode { get; set; }

Property Value

InterpolationMode

Multithreaded

Gets or sets a value indicating whether the rendering engine uses multiple threads to boost performance.

public bool Multithreaded { get; set; }

Property Value

bool

SlowAntialiasing

Gets or sets a value indicating whether the antialiasing algorithm should produce better quality with lower speed.

public bool SlowAntialiasing { get; set; }

Property Value

bool

Transform

Gets or sets the world transformation matrix.

public Matrix3x2 Transform { get; set; }

Property Value

System.Numerics.Matrix3x2

TransformInverse

Gets or sets the inverted world transformation matrix. Used for filling regions with gradient brushes.

TransformInverse is automatically updated when the Transform property is changed.

public Matrix3x2 TransformInverse { get; set; }

Property Value

System.Numerics.Matrix3x2

TransparencyMaskBitmap

Gets or sets a grayscale bitmap providing transparency mask for all drawing and filling operations.

Pixels in the mask with value 0 are fully opaque and will completely mask any drawing (i.e. the pixels of the target bitmap will remain unchanged). Pixels in the mask with value 255 are fully transparent, i.e. any drawing will have the same effect as if there was no mask. Pixels with values between 0 and 255 will modify the transparency of the pixels being drawn according to their value.

Note that the transparency mask bitmap must be of the same pixel size as the target bitmap.

public GrayscaleBitmap TransparencyMaskBitmap { get; set; }

Property Value

GrayscaleBitmap

UpdatedPixelMask

Gets or sets a BilevelBitmap that can be used to monitor changes in the target bitmap. Its pixels are used as boolean flags indicating changes in the target. When a pixel in the target bitmap is changed, the corresponding pixel in this bitmap is set to 1 (true). The BilevelBitmap must have the same pixel size as the target bitmap. It is user's responsibility to clear this bitmap (fill it with zeros) before any drawing on the target occurs.

public BilevelBitmap UpdatedPixelMask { get; set; }

Property Value

BilevelBitmap

Methods

Clear(Color)

Clears the image with the specified color.

public void Clear(Color color)

Parameters

color System.Drawing.Color

Clear(uint)

Clears the image with the specified color.

public void Clear(uint color = 16777215)

Parameters

color uint

DrawBitmap(GcBitmap, RectangleF, float)

Draws a Bitmap at the specified location and with the specified size.

public void DrawBitmap(GcBitmap bitmap, RectangleF rect, float opacity = 1)

Parameters

bitmap GcBitmap

The Bitmap to draw.

rect System.Drawing.RectangleF

Specifies the location and size of the drawn image.

opacity float

The opacity [0, 1] of the source bitmap, to multiply to the source bitmap's alpha channel.

DrawTextLayout(TextLayout, float, float)

Draws a TextLayout at the given location.

public void DrawTextLayout(TextLayout layout, float x, float y)

Parameters

layout TextLayout

The TextLayout to draw.

x float

The origin x-coordinate.

y float

The origin y-coordinate.

FillPath(GraphicsPath, Brush, RectangleF)

Fills a GraphicsPath with the given brush.

public void FillPath(GraphicsPath path, Brush brush, RectangleF brushBounds)

Parameters

path GraphicsPath
brush Brush
brushBounds System.Drawing.RectangleF

FillPath(GraphicsPath, Brush)

Fills a GraphicsPath with the given brush.

public void FillPath(GraphicsPath path, Brush brush)

Parameters

path GraphicsPath
brush Brush

FillPath(GraphicsPath, Color)

Fills a GraphicsPath with a solid color.

public void FillPath(GraphicsPath path, Color color)

Parameters

path GraphicsPath
color System.Drawing.Color

FillPath(GraphicsPath, uint)

Fills a GraphicsPath with a solid color.

public void FillPath(GraphicsPath path, uint color)

Parameters

path GraphicsPath
color uint

FillRegion(Region, Brush, RectangleF)

Fills a Region with the given brush.

public void FillRegion(Region region, Brush brush, RectangleF brushBounds)

Parameters

region Region
brush Brush
brushBounds System.Drawing.RectangleF

FillRegion(Region, Brush)

Fills a Region with the given brush.

public void FillRegion(Region region, Brush brush)

Parameters

region Region
brush Brush

FillRegion(Region, Color)

Fills a Region with a solid color.

public void FillRegion(Region region, Color color)

Parameters

region Region
color System.Drawing.Color

FillRegion(Region, uint)

Fills a Region with a solid color.

public void FillRegion(Region region, uint color)

Parameters

region Region
color uint