[]
Provides methods for drawing on a GcBitmap.
public class BitmapRenderer
Gets or sets a value indicating whether the graphic objects are drawn without anti-aliasing.
public bool Aliased { get; set; }
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; }
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; }
Gets the target bitmap.
public GcBitmap Bitmap { get; }
Gets or sets the method of mixing source and destination colors when drawing.
Default is Normal.
public BlendMode BlendMode { get; set; }
Gets or sets a rectangle, in pixels, to which all subsequent drawing operations are clipped.
public Rectangle? ClipRect { get; set; }
Gets or sets a region to which the subsequient drawing operations are clipped.
public Region ClipRegion { get; set; }
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; }
Gets or sets the sampling mode to use when drawing bitmaps with resizing.
Default is Linear.
public InterpolationMode InterpolationMode { get; set; }
Gets or sets a value indicating whether the rendering engine uses multiple threads to boost performance.
public bool Multithreaded { get; set; }
Gets or sets a value indicating whether the antialiasing algorithm should produce better quality with lower speed.
public bool SlowAntialiasing { get; set; }
Gets or sets the world transformation matrix.
public Matrix3x2 Transform { get; set; }
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; }
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; }
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; }
Clears the image with the specified color.
public void Clear(Color color)
color
System.Drawing.ColorClears the image with the specified color.
public void Clear(uint color = 16777215)
color
uintDraws a Bitmap at the specified location and with the specified size.
public void DrawBitmap(GcBitmap bitmap, RectangleF rect, float opacity = 1)
bitmap
GcBitmapThe Bitmap to draw.
rect
System.Drawing.RectangleFSpecifies the location and size of the drawn image.
opacity
floatThe opacity [0, 1] of the source bitmap, to multiply to the source bitmap's alpha channel.
Draws a TextLayout at the given location.
public void DrawTextLayout(TextLayout layout, float x, float y)
layout
TextLayoutThe TextLayout to draw.
x
floatThe origin x-coordinate.
y
floatThe origin y-coordinate.
Fills a GraphicsPath with the given brush.
public void FillPath(GraphicsPath path, Brush brush, RectangleF brushBounds)
path
GraphicsPathbrush
BrushbrushBounds
System.Drawing.RectangleFFills a GraphicsPath with the given brush.
public void FillPath(GraphicsPath path, Brush brush)
path
GraphicsPathbrush
BrushFills a GraphicsPath with a solid color.
public void FillPath(GraphicsPath path, Color color)
path
GraphicsPathcolor
System.Drawing.ColorFills a GraphicsPath with a solid color.
public void FillPath(GraphicsPath path, uint color)
path
GraphicsPathcolor
uintFills a Region with the given brush.
public void FillRegion(Region region, Brush brush, RectangleF brushBounds)
Fills a Region with the given brush.
public void FillRegion(Region region, Brush brush)
Fills a Region with a solid color.
public void FillRegion(Region region, Color color)
region
Regioncolor
System.Drawing.ColorFills a Region with a solid color.
public void FillRegion(Region region, uint color)
region
Regioncolor
uint