ICanvas

All Implemented Interfaces: com.aspose.ms.System.IDisposable

public interface ICanvas extends System.IDisposable

Represents generic canvas for barcode generation drawing.

Methods

Method Description
clear(System.Drawing.Color color) Clears all canvas with specified color.
createBrush(System.Drawing.Color color) Creates brush for current canvas.
createPen(System.Drawing.Color color, float thickness) Creates pen for current canvas.
drawLine(IPen pen, System.Drawing.Point p1, System.Drawing.Point p2) Draws line between two points with specified pen.
drawLine(IPen pen, System.Drawing.PointF p1, System.Drawing.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, System.Drawing.Font font, IBrush brush, System.Drawing.PointF origin) Draws text from specified origin point.
drawText(String text, System.Drawing.Font font, IBrush brush, System.Drawing.RectangleF bounds) Draws text in the specified text box rectangle.
drawText(String text, System.Drawing.Font font, IBrush brush, System.Drawing.RectangleF bounds, TextOptions options) Draws text in the specified text box rectangle with additional options.
drawText(String text, System.Drawing.Font 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, System.Drawing.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(System.Drawing.Color color)

public abstract void clear(System.Drawing.Color color)

Clears all canvas with specified color.

Parameters:

Parameter Type Description
color com.aspose.ms.System.Drawing.Color Color to clear.

createBrush(System.Drawing.Color color)

public abstract IBrush createBrush(System.Drawing.Color color)

Creates brush for current canvas.

Parameters:

Parameter Type Description
color com.aspose.ms.System.Drawing.Color Solid color of the brush.

Returns: IBrush - Brush, which can be used with this canvas.

createPen(System.Drawing.Color color, float thickness)

public abstract IPen createPen(System.Drawing.Color color, float thickness)

Creates pen for current canvas.

Parameters:

Parameter Type Description
color com.aspose.ms.System.Drawing.Color Solid color of the pen.
thickness float Thickness in pixels of the pen.

Returns: IPen - Pen, which can be used with this canvas.

drawLine(IPen pen, System.Drawing.Point p1, System.Drawing.Point p2)

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

Draws line between two points with specified pen.

Parameters:

Parameter Type Description
pen IPen Pen to draw.
p1 com.aspose.ms.System.Drawing.Point Start line point.
p2 com.aspose.ms.System.Drawing.Point End line point.

drawLine(IPen pen, System.Drawing.PointF p1, System.Drawing.PointF p2)

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

Draws line between two points with specified pen.

Parameters:

Parameter Type Description
pen IPen Pen to draw.
p1 com.aspose.ms.System.Drawing.PointF Start line point.
p2 com.aspose.ms.System.Drawing.PointF End 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:

Parameter Type Description
pen IPen Pen to draw.
rectangle com.aspose.ms.System.Drawing.Rectangle Rectangle 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:

Parameter Type Description
pen IPen Pen to draw.
rectangle com.aspose.ms.System.Drawing.RectangleF Rectangle coordinates in pixels to draw.

drawText(String text, System.Drawing.Font font, IBrush brush, System.Drawing.PointF origin)

public abstract void drawText(String text, System.Drawing.Font font, IBrush brush, System.Drawing.PointF origin)

Draws text from specified origin point.

Parameters:

Parameter Type Description
text java.lang.String Text to draw.
font com.aspose.ms.System.Drawing.Font Font of the text.
brush IBrush Brush to fill text.
origin com.aspose.ms.System.Drawing.PointF Origin point of the text.

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

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

Draws text in the specified text box rectangle.

Parameters:

Parameter Type Description
text java.lang.String Text to draw.
font com.aspose.ms.System.Drawing.Font Font of the text.
brush IBrush Brush to fill text.
bounds com.aspose.ms.System.Drawing.RectangleF Bounds of the text box.

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

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

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

Parameters:

Parameter Type Description
text java.lang.String Text to draw.
font com.aspose.ms.System.Drawing.Font Font of the text.
brush IBrush Brush to fill text.
bounds com.aspose.ms.System.Drawing.RectangleF Bounds of the text box.
options TextOptions Additional drawing options.

drawText(String text, System.Drawing.Font font, IBrush brush, float x, float y)

public abstract void drawText(String text, System.Drawing.Font font, IBrush brush, float x, float y)

Draws text from specified origin point.

Parameters:

Parameter Type Description
text java.lang.String Text to draw.
font com.aspose.ms.System.Drawing.Font Font of the text.
brush IBrush Brush to fill text.
x float X-coordinate in pixels of origin point.
y float Y-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:

Parameter Type Description
brush IBrush Brush to fill.
rectangle com.aspose.ms.System.Drawing.RectangleF Bounds of ellipse in pixels to fill.

fillPolygon(IBrush brush, System.Drawing.Point[] points)

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

Parameters:

Parameter Type Description
brush IBrush
points com.aspose.ms.System.Drawing.Point[]

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

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

Fills rectangle with specified brush.

Parameters:

Parameter Type Description
brush IBrush Brush to fill.
rectangle com.aspose.ms.System.Drawing.Rectangle Rectangle 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:

Parameter Type Description
brush IBrush Brush to fill.
rectangle com.aspose.ms.System.Drawing.RectangleF Rectangle 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: CanvasQualityMode - Gets image quality mode.

rotateTransform(float angle)

public abstract void rotateTransform(float angle)

Applies rotate transform for all further drawing.

Parameters:

Parameter Type Description
angle float Angle of rotation in degrees.

setScaleX(float scaleX)

public abstract void setScaleX(float scaleX)

Sets scale factor for all further drawings

Parameters:

Parameter Type Description
scaleX float scale factor

translateTransform(float offsetX, float offsetY)

public abstract void translateTransform(float offsetX, float offsetY)

Applies translate transform for all further drawing.

Parameters:

Parameter Type Description
offsetX float offset X in pixels.
offsetY float offset Y in pixels.