Download MetaTrader 5
MQL5 ReferenceStandard LibraryClass for creating custom graphics 

CCanvas

CCanvas is a class for simplified creation of custom images.

Description

CCanvas class provides creation of a graphical resource (with or without binding to a chart object) and drawing graphical primitives.

Declaration

   class CCanvas

Title

   #include <Canvas\Canvas.mqh>

Class Methods by Groups

Creating

 

Create

Creates a graphical resource without binding to a chart object

CreateBitmap

Creates a graphical resource bound to a chart object

CreateBitmapLabel

Creates a graphical resource bound to a chart object

Destroy

Destroys a graphical resource

Properties

 

ChartObjectName

Receives the name of a bound chart object

ResourceName

Receives the name of a graphical resource

Width

Receives the width of a graphical resource

Height

Receives the height of a graphical resource

LineStyleSet

Sets the line style

Updating an object on the screen

 

Update

Displays changes on the screen

Resize

Resizes a graphical resource

Erasing/Filling with color

 

Erase

Erases or fills with the specified color

Data access

 

PixelGet

Receives color of the dot with the specified coordinates

PixelSet

Sets color of the dot with the specified coordinates

Drawing primitives

 

LineVertical

Draws a vertical line

LineHorizontal

Draws a horizontal line

Line

Draws a freehand line

Polyline

Draws a polyline

Polygon

Draws a polygon

Rectangle

Draws a rectangle

Circle

Draws a circle

Triangle

Draws a triangle

Drawing filled primitives

 

FillRectangle

Draws a filled rectangle

FillCircle

Draws a filled circle

FillTriangle

Draws a filled triangle

Fill

Fills an area

Drawing primitives with antialiasing

 

PixelSetAA

Draws a pixel

LineAA

Draws a line

PolylineAA

Draws a polyline

PolygonAA

Draws a polygon

TriangleAA

Draws a triangle

CircleAA

Draws a circle

Text

 

FontSet

Sets font parameters

FontNameSet

Sets font name

FontSizeSet

Sets font size

FontFlagsSet

Sets font flags

FontAngleSet

Sets font slope angle

FontGet

Receives font parameters

FontNameGet

Receives font name

FontSizeGet

Receives font size

FontFlagsGet

Receives font flags

FontAngleGet

Receives font slope angle

TextOut

Displays text

TextWidth

Receives the text width

TextHeight

Receives the text height

TextSize

Receives the text size

Transparency

 

TransparentLevelSet

Sets transparency level

Input/output

 

LoadFromFile

Reads an image from a BMP file


Updated: 2016.04.11