Class Canvas

Inheritance

Object Canvas 🡄 CustomCanvas 🡄 Object

Properties

Brush The brush object.
Font The font object
Height Height of the canvas.
Pen The pen object.
Width Width of the canvas.

Methods

clear () Clears the canvas.
copyRect ( dest_x1, dest_y1, dest_x2, dest_y2, sourceCanvas, source_x1, source_y1, source_x2, source_y2 ) Draws an image from one source to another.
draw ( x, y, graphic ) Draw the image of a specific Graphic class.
ellipse ( x1, y1, x2, y2 )
fillRect ( x1, y1, x2, y2 )
floodFill ( x, y, color, opt ) Fills the picture till/with a color.
getBrush () Returns the brush object of this canvas.
getClipRect () Returns a table containing the fields Left, Top, Right and Bottom, which define the invalidated region of the graphical object.
getFont () Returns the font object of this canvas.
getHeight ()
getPen () Returns the pen object of this canvas.
getPenPosition ()
getPixel ( x, y )
getTextHeight ( text )
getTextWidth ( text )
getWidth ()
gradientFill ( x1, y1, x2, y2, startcolor, stopcolor, direction ) Gradient fills a rectangle.
line ( sourcex, sourcey, destinationx, destinationy )
lineTo ( destinationx, destinationy )
rect ( x1, y1, x2, y2 )
setPenPosition ( x, y )
setPixel ( x, y, color )
textOut ( x, y, text )


Inheritance

Object
Canvas 🡄 CustomCanvas 🡄 Object

Properties

Brush
The brush object.

Type:

Font
The font object

Type:

Height
Height of the canvas.

Type:

    integer
Pen
The pen object.

Type:

Width
Width of the canvas.

Type:

    integer

Methods

clear ()
Clears the canvas.
copyRect ( dest_x1, dest_y1, dest_x2, dest_y2, sourceCanvas, source_x1, source_y1, source_x2, source_y2 )
Draws an image from one source to another. Useful in cases of doublebuffering.

Parameters:

  • dest_x1
  • dest_y1
  • dest_x2
  • dest_y2
  • sourceCanvas
  • source_x1
  • source_y1
  • source_x2
  • source_y2
draw ( x, y, graphic )
Draw the image of a specific Graphic class.

Parameters:

  • x integer
  • y integer
  • graphic
ellipse ( x1, y1, x2, y2 )

Parameters:

  • x1
  • y1
  • x2
  • y2
fillRect ( x1, y1, x2, y2 )

Parameters:

  • x1
  • y1
  • x2
  • y2
floodFill ( x, y, color, opt )
Fills the picture till/with a color.

filltype can be: - fsSurface: fill till the color (it fills all except this color)
- fsBorder: fill this color (it fills only connected pixels of this color)

Parameters:

  • x
  • y
  • color (default=brush.Color) (optional)
  • opt ] filltype (default=fsSurface)
getBrush ()
Returns the brush object of this canvas.

Returns:

    Brush
getClipRect ()
Returns a table containing the fields Left, Top, Right and Bottom, which define the invalidated region of the graphical object. Use this to only render what needs to be rendered in the onPaint event of objects.

Returns:

    table
getFont ()
Returns the font object of this canvas.

Returns:

    Font
getHeight ()

Returns:

    integer
getPen ()
Returns the pen object of this canvas.

Returns:

    Pen
getPenPosition ()
getPixel ( x, y )

Parameters:

  • x
  • y
getTextHeight ( text )

Parameters:

  • text
getTextWidth ( text )

Parameters:

  • text
getWidth ()

Returns:

    integer
gradientFill ( x1, y1, x2, y2, startcolor, stopcolor, direction )
Gradient fills a rectangle.

Direction can be 0 or 1. 0=Vertical 1=Horizontal.

Parameters:

  • x1
  • y1
  • x2
  • y2
  • startcolor
  • stopcolor
  • direction integer
line ( sourcex, sourcey, destinationx, destinationy )

Parameters:

  • sourcex
  • sourcey
  • destinationx
  • destinationy
lineTo ( destinationx, destinationy )

Parameters:

  • destinationx
  • destinationy
rect ( x1, y1, x2, y2 )

Parameters:

  • x1
  • y1
  • x2
  • y2
setPenPosition ( x, y )

Parameters:

  • x integer
  • y integer
setPixel ( x, y, color )

Parameters:

  • x
  • y
  • color
textOut ( x, y, text )

Parameters:

  • x
  • y
  • text
generated by LDoc 1.4.6-antum-dev-1 Last updated 2019-02-27 23:30:35