Table of Contents

Class Canvas

Namespace
BOOSE
Assembly
BOOSE.dll

Abstract class that implements CanvasInterface. See CanvasInterface documentation for what to implement. This class handles all the drawing on your system according to above documentation. BOOSE does not by default specify a default drawing Canvas (only this).

public class Canvas : ICanvas
Inheritance
Canvas
Implements
Inherited Members

Constructors

Canvas()

public Canvas()

Fields

background_colour

protected Color background_colour

Field Value

Color

Properties

PenColour

Get/Set the Pencolour for next drawing operation using a native colour datatype. Cast to relevant type.

public virtual object PenColour { get; set; }

Property Value

object

Xpos

X position of next drawing operation.

public virtual int Xpos { get; set; }

Property Value

int

Ypos

Y position of next drawing position

public virtual int Ypos { get; set; }

Property Value

int

Methods

Circle(int, bool)

Draw a circle at cursor position of radius.

public virtual void Circle(int radius, bool filled)

Parameters

radius int

Radius of circle.

filled bool

If True circle is drawn filled, outline if false.

Clear()

Fill the background in the default colour.

public virtual void Clear()

DrawTo(int, int)

Draw a line using the current pen from the last drawingf position to the specified position and move the cursor position to the provided x,y

public virtual void DrawTo(int x, int y)

Parameters

x int

specified X position.

y int

specified Y position.

MoveTo(int, int)

Move the X and Y of the next drawing operation.

public virtual void MoveTo(int x, int y)

Parameters

x int

X position of cursor.

y int

Y position of cursor.

Rect(int, int, bool)

Draw a rectangle at cursor position of width and height.

public virtual void Rect(int width, int height, bool filled)

Parameters

width int
height int
filled bool

Rectangle(int, int, bool)

public virtual void Rectangle(int width, int height, bool filled)

Parameters

width int
height int
filled bool

Reset()

Reset drawing cursor to 0,0 and reset pen to default.

public virtual void Reset()

Set(int, int)

Set output display size. This method should create whatever drawing display you intend to use of the size specified.

public virtual void Set(int width, int height)

Parameters

width int
height int

SetColour(int, int, int)

Set the pen colour using rgb values.

public virtual void SetColour(int red, int green, int blue)

Parameters

red int
green int
blue int

Tri(int, int)

Draw a triangle in the bounding rectangle.

public virtual void Tri(int width, int height)

Parameters

width int

Width of bounding rectangle.

height int

Height of bounding rectangle.

WriteText(string)

Draws text on the output window at the cursor position

public virtual void WriteText(string text)

Parameters

text string

String to output

getBitmap()

Get the drawing Object of whatever native type. Returned a Object so it can be cast to native type. Use this to get native drawing type so that it can be displayed or output.

public virtual object getBitmap()

Returns

object