ICanvas

public interface ICanvas

Represents generic canvas for barcode generation drawing.

Methods

MethodDescription
clear(int color)Clears all canvas with specified color.
createBrush(int color)Creates brush for current canvas.
createPen(int color, float thickness)Creates pen for current canvas.
drawLine(IPen pen, Point p1, Point p2)Draws line between two points with specified pen.
drawLine(IPen pen, PointF p1, PointF p2)Draws line between two points with specified pen.
drawRectangle(IPen pen, System.Drawing.Rectangle rectangle)Draws rectangle border with specified pen.
drawRectangle(IPen pen, System.Drawing.RectangleF rectangle)Draws rectangle border with specified pen.
drawText(String text, TextPaint font, IBrush brush, PointF origin)Draws text from specified origin point.
drawText(String text, TextPaint font, IBrush brush, System.Drawing.RectangleF bounds)Draws text in the specified text box rectangle.
drawText(String text, TextPaint font, IBrush brush, System.Drawing.RectangleF bounds, TextOptions options)Draws text in the specified text box rectangle with additional options.
drawText(String text, TextPaint font, IBrush brush, float x, float y)Draws text from specified origin point.
fillEllipse(IBrush brush, System.Drawing.RectangleF rectangle)Fills ellipse with specified brush.
fillPolygon(IBrush brush, Point[] points)
fillRectangle(IBrush brush, System.Drawing.Rectangle rectangle)Fills rectangle with specified brush.
fillRectangle(IBrush brush, System.Drawing.RectangleF rectangle)Fills rectangle with specified brush.
getCanvasSize()
getOffsetX()
getOffsetY()
getQualityMode()
rotateTransform(float angle)Applies rotate transform for all further drawing.
setScaleX(float scaleX)Sets scale factor for all further drawings
translateTransform(float offsetX, float offsetY)Applies translate transform for all further drawing.

clear(int color)

public abstract void clear(int color)

Clears all canvas with specified color.

Parameters:

ParameterTypeDescription
colorintColor to clear.

createBrush(int color)

public abstract IBrush createBrush(int color)

Creates brush for current canvas.

Parameters:

ParameterTypeDescription
colorintSOLID color of the brush.

Returns: com.aspose.barcode.drawing.IBrush - Brush, which can be used with this canvas.

createPen(int color, float thickness)

public abstract IPen createPen(int color, float thickness)

Creates pen for current canvas.

Parameters:

ParameterTypeDescription
colorintSOLID color of the pen.
thicknessfloatThickness in pixels of the pen.

Returns: com.aspose.barcode.drawing.IPen - Pen, which can be used with this canvas.

drawLine(IPen pen, Point p1, Point p2)

public abstract void drawLine(IPen pen, Point p1, Point p2)

Draws line between two points with specified pen.

Parameters:

ParameterTypeDescription
pencom.aspose.barcode.drawing.IPenPen to draw.
p1android.graphics.PointStart line point.
p2android.graphics.PointEnd line point.

drawLine(IPen pen, PointF p1, PointF p2)

public abstract void drawLine(IPen pen, PointF p1, PointF p2)

Draws line between two points with specified pen.

Parameters:

ParameterTypeDescription
pencom.aspose.barcode.drawing.IPenPen to draw.
p1android.graphics.PointFStart line point.
p2android.graphics.PointFEnd line point.

drawRectangle(IPen pen, System.Drawing.Rectangle rectangle)

public abstract void drawRectangle(IPen pen, System.Drawing.Rectangle rectangle)

Draws rectangle border with specified pen.

Parameters:

ParameterTypeDescription
pencom.aspose.barcode.drawing.IPenPen to draw.
rectanglecom.aspose.ms.System.Drawing.RectangleRectangle coordinates in pixels to draw.

drawRectangle(IPen pen, System.Drawing.RectangleF rectangle)

public abstract void drawRectangle(IPen pen, System.Drawing.RectangleF rectangle)

Draws rectangle border with specified pen.

Parameters:

ParameterTypeDescription
pencom.aspose.barcode.drawing.IPenPen to draw.
rectanglecom.aspose.ms.System.Drawing.RectangleFRectangle coordinates in pixels to draw.

drawText(String text, TextPaint font, IBrush brush, PointF origin)

public abstract void drawText(String text, TextPaint font, IBrush brush, PointF origin)

Draws text from specified origin point.

Parameters:

ParameterTypeDescription
textjava.lang.StringText to draw.
fontandroid.text.TextPaintFont of the text.
brushcom.aspose.barcode.drawing.IBrushBrush to fill text.
originandroid.graphics.PointFOrigin point of the text.

drawText(String text, TextPaint font, IBrush brush, System.Drawing.RectangleF bounds)

public abstract void drawText(String text, TextPaint font, IBrush brush, System.Drawing.RectangleF bounds)

Draws text in the specified text box rectangle.

Parameters:

ParameterTypeDescription
textjava.lang.StringText to draw.
fontandroid.text.TextPaintFont of the text.
brushcom.aspose.barcode.drawing.IBrushBrush to fill text.
boundscom.aspose.ms.System.Drawing.RectangleFBounds of the text box.

drawText(String text, TextPaint font, IBrush brush, System.Drawing.RectangleF bounds, TextOptions options)

public abstract void drawText(String text, TextPaint font, IBrush brush, System.Drawing.RectangleF bounds, TextOptions options)

Draws text in the specified text box rectangle with additional options.

Parameters:

ParameterTypeDescription
textjava.lang.StringText to draw.
fontandroid.text.TextPaintFont of the text.
brushcom.aspose.barcode.drawing.IBrushBrush to fill text.
boundscom.aspose.ms.System.Drawing.RectangleFBounds of the text box.
optionscom.aspose.barcode.drawing.TextOptionsAdditional drawing options.

drawText(String text, TextPaint font, IBrush brush, float x, float y)

public abstract void drawText(String text, TextPaint font, IBrush brush, float x, float y)

Draws text from specified origin point.

Parameters:

ParameterTypeDescription
textjava.lang.StringText to draw.
fontandroid.text.TextPaintFont of the text.
brushcom.aspose.barcode.drawing.IBrushBrush to fill text.
xfloatX-coordinate in pixels of origin point.
yfloatY-coordinate in pixels of origin point.

fillEllipse(IBrush brush, System.Drawing.RectangleF rectangle)

public abstract void fillEllipse(IBrush brush, System.Drawing.RectangleF rectangle)

Fills ellipse with specified brush.

Parameters:

ParameterTypeDescription
brushcom.aspose.barcode.drawing.IBrushBrush to fill.
rectanglecom.aspose.ms.System.Drawing.RectangleFBounds of ellipse in pixels to fill.

fillPolygon(IBrush brush, Point[] points)

public abstract void fillPolygon(IBrush brush, Point[] points)

Parameters:

ParameterTypeDescription
brushcom.aspose.barcode.drawing.IBrush
pointsandroid.graphics.Point[]

fillRectangle(IBrush brush, System.Drawing.Rectangle rectangle)

public abstract void fillRectangle(IBrush brush, System.Drawing.Rectangle rectangle)

Fills rectangle with specified brush.

Parameters:

ParameterTypeDescription
brushcom.aspose.barcode.drawing.IBrushBrush to fill.
rectanglecom.aspose.ms.System.Drawing.RectangleRectangle coordinates in pixels to fill.

fillRectangle(IBrush brush, System.Drawing.RectangleF rectangle)

public abstract void fillRectangle(IBrush brush, System.Drawing.RectangleF rectangle)

Fills rectangle with specified brush.

Parameters:

ParameterTypeDescription
brushcom.aspose.barcode.drawing.IBrushBrush to fill.
rectanglecom.aspose.ms.System.Drawing.RectangleFRectangle coordinates in pixels to fill.

getCanvasSize()

public abstract System.Drawing.Size getCanvasSize()

Returns: com.aspose.ms.System.Drawing.Size - Gets actual canvas size in pixels.

getOffsetX()

public abstract float getOffsetX()

Returns: float - Gets translate offset X in pixels.

getOffsetY()

public abstract float getOffsetY()

Returns: float - Gets translate offset Y in pixels.

getQualityMode()

public abstract CanvasQualityMode getQualityMode()

Returns: com.aspose.barcode.drawing.CanvasQualityMode - Gets image quality mode.

rotateTransform(float angle)

public abstract void rotateTransform(float angle)

Applies rotate transform for all further drawing.

Parameters:

ParameterTypeDescription
anglefloatAngle of rotation in degrees.

setScaleX(float scaleX)

public abstract void setScaleX(float scaleX)

Sets scale factor for all further drawings

Parameters:

ParameterTypeDescription
scaleXfloatscale factor

translateTransform(float offsetX, float offsetY)

public abstract void translateTransform(float offsetX, float offsetY)

Applies translate transform for all further drawing.

Parameters:

ParameterTypeDescription
offsetXfloatOffset X in pixels.
offsetYfloatOffset Y in pixels.