---
title: "BaseGraphicClass"
canonical: "https://docs.cuesystem.com/space/CVCHELP/515014657/BaseGraphicClass"
format: markdown
---
> Macro (toc)

---

**NOTE** 

All draw commands can be used inside the function OnDraw only. Outside the function OnDraw, they do nothing. 

# DrawAnimationFrame

This function works the same as the **DrawPicture** function with the difference - it uses a picture (one frame) from an animation stored in resources. Frame numbering starts on number one. If you want to play animation continuously it is necessary to use the **DrawAnimationFrame** function in the **OnTimer** function and to start the timer using the appropriate period. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawAnimationFrame( 
  anim As _Animation, 
  frameindex As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional addtiveopacity As Byte := 255)
```

#### Parameters 

anim 

<u>[_Animation](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/514719745)</u> It is the animation. 

frameindex 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the number of the index. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation destination. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the animation source. If it is -1 by default, the full width of the source is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the animation source. If it is -1 by default, the full height of the source is used. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation source 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity. 

# DrawLine

This function draws a line from the start point (**x1, y1**) to the end point (**x2, y2**). A color including opacity is defined by the parameter **linecolor**. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawLine( 
  x1 As Long, 
  y1 As Long, 
  x2 As Long, 
  y2 As Long, 
  linecolor As Long)
```

#### Parameters 

x1 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate of the start of the line. 

y1 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate of the start of the line. 

x2 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate of the end of the line. 

y2 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate of the end of the line. 

x1 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the number of the line color. 

# DrawPicture

This function draws an image of the object. The image may have its transparency (alpha channel). If you use default values of parameters, then the whole picture is drawn from the beginning of the object. The image is always cropped by object borders. If we want to move the picture towards the beginning of the object or we want to draw only part of the image, then we can choose appropriate parameters. If the parameter **additiveopacity** is used, then additional opacity is applied before drawing. The image can be more transparent. 

Parameters **dstx**, **dsty**, **srcx**, **srcy**, **width**, and **height** affect the drawing method according to the following pictures. 

![image](media://024585dc-9964-4040-b732-8053ee9b9e68)

![image](media://10941648-14e8-45b8-92e1-5afcda86b45c)

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawPicture( 
  picture As _Picture, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional addtiveopacity As Byte := 255)
```

#### Parameters 

picture 

<u>[_Picture](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401)</u> It is the picture. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture destination. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the picture source. If it is -1 by default, the full width of the source is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the picture source. If it is -1 by default, the full height of the source is used. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture source. 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity. 

# DrawRotatedPicture

This function is intended to draw the picture in the rotated position. As other draw functions, this function can be used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawRotatedPicture( 
  picture As _Picture, 
  angle As Double, 
  rotationx As Double, 
  rotationy As Double,  
  dstx As Double, 
  dsty As Double)
```

#### Parameters 

picture 

<u>[_Picture](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401)</u> It is the picture to be drawn as rotated.

angle 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> The rotation angle. The positive angle is clockwise. 

rotationx 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> The X coordinate of the center of the rotation. The center of the rotation can or cannot be inside the picture. The coordinates are counted from the left-up corner of the picture. Positive X is to the right. The coordinates are in pixels, but you can use decimal number. For example x = 3.2 pixels. 

rotationy 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> The Y coordinate of the center of the rotation. The coordinates are counted from the left-up corner of the picture. Positive Y is down. The coordinates are in pixels, but you can use decimal number. For example, y = 5.8 pixels. 

dstx 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the X position of the center of the rotation in the result graphic object. That coordinates are in pixels and again - you can use no integer number - for example 14.5. 

dsty 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the Y position of the center of the rotation in the result graphic object. That coordinates are in pixels and again - you can use no integer number - for example 14.5. 

# DrawRectangle

This function draws a defined color with transparency into the rectangular image area. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawRectangle( 
  fillcolor As Long, 
  Optional x As Long := 0 , 
  Optional y As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1)
```

#### Parameters 

fillcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color to draw. 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the left top corner. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the top corner. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the rectangle. If it is -1 by default, the width of the object to which it is drawn is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the rectangle. If it is -1 by default, the height of the object to which it is drawn is used. 


# DrawRoundedRectangle

This function draws a defined color with transparency into the rounded rectangle with optional border.

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

> ℹ️ This function is supported since firmware 21.40

#### Syntax 

```
Function DrawRectangle( 
  fillcolor As Long, 
  radius As Long,
  Optional x As Long := 0 , 
  Optional y As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1,
  Optional borderwidth As Long := 0,
  Optional bordercolor As Long := 0,
  Optional roundedcorners As Long := &H0F)
```

#### Parameters 

fillcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color to draw. 

radius

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the radius of the conrner rounding.

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the left top corner. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the top corner. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the rectangle. If it is -1 by default, the width of the object to which it is drawn is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the rectangle. If it is -1 by default, the height of the object to which it is drawn is used. 

borderwidth

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the width of the border. 

bordercolorcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color to draw a border. 

roundedcorners

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is flag which corner shoud be rounded a which should be sharp. Default value is that all four corners are rounded.

You can use constants _ROUNDEDRECTANGLE_LEFTTOP, _ROUNDEDRECTANGLE_RIGHTTOP, _ROUNDEDRECTANGLE_LEFTBOTTOM or  _ROUNDEDRECTANGLE_RIGHTBOTTOM to specify which corner shoud be rounded. If you want more rounded corners please use BitOr between constants

 

# DrawStretchedAnimationFrame

This function works the same as the **DrawStretchedPicture** function with the difference - it uses a picture (one frame) from an animation stored in resources. Frame numbering starts on number one. If you want to play animation continuously it is necessary to use the **DrawStretchedAnimationFrame** function in the **OnTimer** function and to start the timer using the appropriate period. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawStretchedAnimationFrame( 
  anim As _Animation, 
  frameindex As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional dstwidth As Long := -1, 
  Optional dstheight As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional srcwidth As Long := -1, 
  Optional srcheight As Long:= -1, 
  Optional additiveopacity As Byte:= 255)
```

#### Parameters 

anim 

<u>[_Animation](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/514719745)</u> It is the animation. 

frameindex 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the number of the index. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation destination. 

dstwidth 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the dstwidth of the animation source. If it is -1 by default, the full width of the source is used. 

dstheight 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the dstheight of the animation source. If it is -1 by default, the full height of the source is used. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation source. 

srcwidth  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total width of the source animation. 

srcheight  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total height of the source animation.

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity.  

# DrawStretchedPicture 

This function can draw the picture like the function DrawPicture. But the function DrawStrechedPicture can zoom the source picture. The zoom factor is not limited, but the real factor for the nice result is from one half to two. 

#### Syntax 

```visualbasic
Function DrawStretchedPicture( 
  picture As _Picture, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional dstwidth As Long := -1, 
  Optional dstheight As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional srcwidth As Long := -1, 
  Optional srcheight As Long:= -1, 
  Optional additiveopacity As Byte:= 255)
```

#### Parameters 

picture 

<u>[_Picture](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401)</u> It is the picture. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture destination. 

dstwidth 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The destination width specifies the x-zoom factor. The value -1 specifies the width of the graphic object the picture is drawn to. 

dstheight 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The destination height specifies the y-zoom factor. The value -1 specifies the height of the graphic object the picture is drawn to. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture source. 

srcwidth  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total width of the source picture. 

srcheight  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total height of the source picture. 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity given to the drawn picture. 

# DrawStretchedTintedAnimationFrame

This function works the same as the **DrawStretchedTintedPicture** function with the difference - it uses a picture (one frame) from an animation stored in resources. A frame numbering starts on number one. If you want to play animation continuously it is necessary to use the **DrawStretchedTintedAnimationFrame** function in the **OnTimer** function and to start the timer using the appropriate period. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawStretchedTintedAnimationFrame( 
  anim As _Animation, 
  frameindex As Long, 
  tintcolor As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional dstwidth As Long := -1, 
  Optional dstheight As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional srcwidth As Long := -1, 
  Optional srcheight As Long:= -1, 
  Optional additiveopacity As Byte := 255)
```

#### Parameters 

anim 

<u>[_Animation](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/514719745)</u> It is the animation. 

frameindex 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the number of the index. 

tintcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation destination. 

dstwidth 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the dstwidth of the animation source. If it is -1 by default, the full width of the source is used. 

dstheight 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the dstheight of the animation source. If it is -1 by default, the full height of the source is used. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation source. 

srcwidth  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total width of the source animation. 

srcheight  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total height of the source animation. 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity. 

# DrawStretchedTintedPicture

This function works in the same way as the function DrawStretchedPicture with a distinction that the result can be painted with some colored ink above. 

#### Syntax 

```visualbasic
Function DrawStretchedTintedPicture( 
  picture As _Picture, 
  tintcolor As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional dstwidth As Long := -1, 
  Optional dstheight As Long := -1, 
  Optional srcx As Long  := 0, 
  Optional srcy As Long  := 0, 
  Optional srcwidth As Long  := -1, 
  Optional srcheight As Long  := -1, 
  Optional additiveopacity As Byte:= 255)
```

#### Parameters 

picture 

<u>[_Picture](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401)</u> It is the picture. 

tintcolor  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the color of the ink the picture will be colorized with. 

dstx  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture destination. 

dstwidth 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The destination width specifies the x-zoom factor. The value -1 specifies the width of the graphic object the picture is drawn to. 

dstheight 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The destination height specifies the y-zoom factor. The value -1 specifies the height of the graphic object the picture is drawn to. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture source 

srcwidth  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total width of the source picture. 

srcheight  

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The value -1 specifies the total height of the source picture. 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity. 

# DrawText

This function draws the text using a defined font (parameter **font**) and color (parameter **textcolor**). The text is drawn into a rectangle which is defined by parameters **dstx**, **dsty** (position of the left top corner), **width,** and **height**. A drawing format can be defined by parameter **formaflags** which are constructed as the sum of predefined constants. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### The syntax for firmware 4.00 and 4.01 

```visualbasic
Function DrawText( 
  font As _Font, 
  srctext As Text, 
  textcolor As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional formatflags As Long := _TEXT_ALIGNLEFT BitOr _TEXT_ALIGNTOP)
```

#### The syntax for firmware 4.02 and later  

```visualbasic
Function DrawText( 
  font As _Font, 
  srctext As Text, 
  textcolor As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional formatflags As Long := _TEXT_ALIGNLEFT BitOr _TEXT_ALIGNTOP, 
  Optional linespacing As Double := 1.20)
```

#### Parameters 

font 

<u>[_Font](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518914049)</u> It is the font. 

srctext 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u> It is the source text. 

textcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color of the text. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the text. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the text. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the text area. If it is -1 by default, the width of the object to which it is drawn is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the text area. If it is -1 by default, the height of the object to which it is drawn is used. 

formatflags 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to _TEXT_ALIGNLEFT BitOr _TEXT_ALIGNTOP. These are the format flags of the text. They are selected by predefined constants and <u>[operator bitwise or](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522682850/Bitwise+operators#BitOr-operator)</u> (e.g. _TEXT_ALIGNRIGHT BitOr _TEXT_ALIGNTOP). Predefined constants for parameter formatflags are as follows: 

|  |  |  |
| --- | --- | --- |
| Name | Value | Description |
| _TEXT_ALIGNLEFT | &H00000001 | Horizontal align left. |
| _TEXT_ALIGNHCENTER | &H00000002 | Horizontal align center. |
| _TEXT_ALIGNRIGHT | &H00000004 | Horizontal align right. |
| _TEXT_ALIGNTOP | &H00000008 | Vertical align top. |
| _TEXT_ALIGNVCENTER | &H00000010 | Vertical align center. |
| _TEXT_ALIGNBOTTOM | &H00000020 | Vertical align bottom. |
| _TEXT_WORDWRAP | &H00000040 | Wrap text automatically. It is supported from firmware version 4.02. |
| _TEXT_SINGLELINE | &H000000the 80 | Never wrap text and Line Feed character will replace the Space character. It is supported from firmware version 4.02. |

linespacing 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> Optional, defaults to 1.20. It is the vertical distance between lines of text, measured from one line to the next. The value is multiple of the font height. 

# DrawTintedAnimationFrame

This function works the same as the **DrawTintedPicture** function with the difference - it uses a picture (one frame) from an animation stored in resources. A frame numbering starts on number one. If you want to play animation continuously it is necessary to use the **DrawTintedAnimationFrame** function in the **OnTimer** function and to start the timer using the appropriate period. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawTintedAnimationFrame( 
  anim As _Animation, 
  frameindex As Long, 
  tintcolor As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional additiveopacity As Byte := 255)
```

#### Parameters 

anim 

<u>[_Animation](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/514719745)</u> It is the animation. 

frameindex 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the number of the index. 

tintcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation destination. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the animation source. If it is -1 by default, the full width of the source is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the animation source. If it is -1 by default, the full height of the source is used. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the animation source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the animation source. 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity. 

# DrawTintedPicture

This function works the same as the **DrawPicture** function. In addition, it overlaps a picture by a color defined in a parameter **tintcolor**. The overlap happens only in places where the image is at least partially opaque. The result is drawn using additional opacity defined by a parameter **additiveopacity**. 

This function is used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawTintedPicture( 
  picture As _Picture, 
  tintcolor As Long, 
  Optional dstx As Long := 0, 
  Optional dsty As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional srcx As Long := 0, 
  Optional srcy As Long := 0, 
  Optional additiveopacity As Byte := 255)
```

#### Parameters 

picture 

<u>[_Picture](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401)</u> It is the picture. 

tintcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture destination. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the picture source. If it is -1 by default, the full width of the source is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the picture source. If it is -1 by default, the full height of the source is used. 

srcx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the picture source. 

srcy 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the picture source. 

addtiveopacity 

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the additive opacity. 

# DrawTintedRotatedPicture

This function is intended to draw the picture in the rotated position. In addition, it overlaps a picture by a color defined in a parameter **tintcolor**. The overlap happens only in places where the image is at least partially opaque. As other draw functions, this function can be used just in the **OnDraw** function and in functions called from **OnDraw**. Otherwise, the function does nothing. 

#### Syntax 

```visualbasic
Function DrawTintedRotatedPicture( 
  picture As _Picture, 
  tintcolor As Long, 
  angle As Double, 
  rotationx As Double, 
  rotationy As Double,  
  dstx As Double, 
  dsty As Double)
```

#### Parameters 

picture 

<u>[_Picture](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401)</u> It is the picture to be drawn as rotated. 

tintcolor 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color. 

angle 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> The rotation angle. The positive angle is clockwise. 

rotationx 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> The X coordinate of the center of the rotation. The center of the rotation can or cannot be inside the picture. The coordinates are counted from the left-up corner of the picture. Positive X is to the right. The coordinates are in pixels, but you can use decimal number. For example x = 3.2 pixels. 

rotationy 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> The Y coordinate of the center of the rotation. The coordinates are counted from the left-up corner of the picture. Positive Y is down. The coordinates are in pixels, but you can use decimal number. For example, y = 5.8 pixels. 

dstx 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the X position of the center of the rotation in the result graphic object. That coordinates are in pixels and again - you can use no integer number - for example 14.5. 

dsty 

<u>[Double](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the Y position of the center of the rotation in the result graphic object. That coordinates are in pixels and again - you can use no integer number - for example 14.5. 

# DrawVideo

This function draws a video to the object. It is used in the OnDraw function of the graphic object the video is drawn to. 

#### Syntax 

```visualbasic
Function DrawVideo( 
  video As _Video, 
  Optional dstx As Long :=0 , 
  Optional dsty As Long :=0, 
  Optional dstwidth As Long :=-1, 
  Optional dstheight As Long:=-1, 
  Optional opacity As Byte := 255)
```

#### Parameters 

video 

<u>[_Video](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/512327943)</u>. It is the video. 

dstx 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the video destination. 

dsty 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the video destination. 

dstwidth 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The destination width specifies the x-zoom factor. The value -1 specifies the width of the graphic object the video is drawn to. 

dstheight 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. The destination height specifies the y-zoom factor. The value -1 specifies the height of the graphic object the video is drawn to. 

opacity  

<u>[Byte](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the opacity of the video. 

# GetChild

This function returns the address of the object which is specified by a parameter **index**. Objects are numbered from number one. The result of this function can be assigned into a variable of type AddressOf BaseGraphicClass and it allows to address the object. If the result of this function isn't compatible with this type or derived type, the function returns **Nothing**. This feature can be used to verify the type of object. This way you can use only for the objects of that type or for the derived objects. 

#### Syntax 

```visualbasic
Function GetChild(index As Long) As AddressOf BaseGraphicClass
```

#### Parameters 

index 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the index of the object. 

#### Return value 

<u>[AddressOf](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522682857)</u> BaseGraphicClass. It is the address of the object. 

# GetChildCount

This function returns the number of objects contained in the window. 

#### Syntax 

```visualbasic
Function GetChildCount() As Long
```

#### Return value 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the number of objects contained in the window. 

# GetObjectId

This function returns the identification number of the graphic object. This identification number is generated by the compiler and does not change in the runtime. The identification number grows with the default z-order of the object. If there are some composite objects, then the sub-objects do have the object id too. 

#### Syntax 

```visualbasic
Function GetObjectId() As Long
```

#### Return value 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the object id of the graphic object.  

# GetParent

This function returns the parent graphic object of the graphic object. If the object is a window, then the parent object address returned is Nothing. 

#### Syntax 

```visualbasic
Function GetParent() As AddressOf BaseGraphicClass
```

#### Return value 

<u>[AddressOf](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/522682857)</u> BaseGraphicClass. It is the address of the object. 

# GetPosition

This function returns a position of the left top corner. 

Syntax 

```visualbasic
Function GetPosition( 
  ByRef x As Long, 
  ByRef y As Long) 
As Boolean
```

#### Parameters 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. A function GetLastError returns the error numbers  

# GetSize

This function returns the width and height of an object in pixels. 

#### Syntax 

```visualbasic
Function GetSize( 
  ByRef width As Long, 
  ByRef height As Long) 
As Boolean
```

#### Parameters 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the width. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the height. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>

True if the values returned are valid. 

False if the values are not valid.  

# GetVisible

This function returns true if a property Visible of the object is True and a property Visible of a window, where is the object located, is True as well. 

#### Syntax 

```visualbasic
Function GetVisible() As Boolean
```

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True if the property Visible of the: 

- object is True, and
- window (where is the object located) is True.

It is False otherwise. 

# Hide

This function disables the display of an object. Calling this function causes an event Hide and it calls the **OnHide** function. 

#### Syntax 

```visualbasic
Function Hide()
```

# KillFocus

This function removes focus from the object. After removing the focus the object does not receive keyboard events. 

#### Syntax 

```visualbasic
Function KillFocus()
```

# SendToDefault

This function sends the front object (see BringToFront) to the default draw position. If the object is not in the front position, nothing happens. 

#### Syntax 

```visualbasic
Function SendToDefault()
```

# BringToFront

This function brings the graphics object to the front of the window the object is on. The front object is drawn above other objects on the same window. The only object on one window can be moved to the front. If there is one object in front and the command BringToFront is used again with another object, then the actual front object is sent back again (as if it is used the command SendToDefault). 

#### Syntax 

```visualbasic
Function BringToFront()
```

# OnChar

This function is called when the key is pressed on the hardware keyboard and the object has focus. Only in the pcCUE or ipCUE omega. 

#### Syntax 

```visualbasic
Function OnChar( 
  keyboardchar As Char, 
  controlkey As Long)
```

#### Parameters 

*keyboardchar  * 

If the keyboard press has the character representation, then here is it. If it is not the case (for example key F1 is pressed) this parameter has the value 0.  

*controlkey* 

The parameter value represents a combination of control keys pressed. Only combinations in the table below are supported. Control keys are coded as bit value inside the parameter *controlkey*. 

#### Table of control key bit values 

|  |  |  |
| --- | --- | --- |
| Data bit (0-31) | Control key | System constant |
| DB0 | CONTROL | Global Const _CONTROLKEY_CTRL  As Long := &H00000001 |
| DB1 | SHIFT | Global Const _CONTROLKEY_SHIFT As Long := &H00000002 |
| DB2 | ALT | Global Const _CONTROLKEY_ALT As Long := &H00000004 |
| DB3 | CAPS-LOCK | Global Const _CONTROLKEY_CAPSLOCK As Long := &H00000008 |
| DB4 | HOME | Global Const _CONTROLKEY_HOME As Long := &H00000010 |
| DB5 | END | Global Const _CONTROLKEY_END As Long := &H00000020 |
| DB6 | PAGE-UP | Global Const _CONTROLKEY_PAGEUP As Long := &H00000040 |
| DB7 | PAGE-DN | Global Const _CONTROLKEY_PAGEDOWN As Long := &H00000080 |
| DB8 | DELETE | Global Const _CONTROLKEY_DELETE As Long := &H00000100 |
| DB9 | LEFT-ARROW | Global Const _CONTROLKEY_LEFTARROW As Long := &H00000200 |
| DB10 | RIGHT-ARROW | Global Const _CONTROLKEY_RIGHTARROW As Long := &H00000400 |
| DB11 | DOWN-ARROW | Global Const _CONTROLKEY_DOWNARROW As Long := &H00000800 |
| DB12 | UP-ARROW | Global Const _CONTROLKEY_UPARROW As Long := &H00001000 |
| DB13 | INSERT | Global Const _CONTROLKEY_INSERT As Long := &H00002000 |
| DB14 | --- not used --- |  |
| DB15 | --- not used --- |  |
| DB16 | --- not used --- |  |
| DB17 | --- not used --- |  |
| DB18 | --- not used --- |  |
| DB19 | --- not used --- |  |
| DB20 | F1 | Global Const _CONTROLKEY_F1 As Long := &H00100000 |
| DB21 | F2 | Global Const _CONTROLKEY_F2 As Long := &H00200000 |
| DB22 | F3 | Global Const _CONTROLKEY_F3 As Long := &H00400000 |
| DB23 | F4 | Global Const _CONTROLKEY_F4 As Long := &H00800000 |
| DB24 | F5 | Global Const _CONTROLKEY_F5 As Long := &H01000000 |
| DB25 | F6 | Global Const _CONTROLKEY_F6 As Long := &H02000000 |
| DB26 | F7 | Global Const _CONTROLKEY_F7 As Long := &H04000000 |
| DB27 | F8 | Global Const _CONTROLKEY_F8 As Long := &H08000000 |
| DB28 | F9 | Global Const _CONTROLKEY_F9 As Long := &H10000000 |
| DB29 | F10 | Global Const _CONTROLKEY_F10 As Long := &H20000000 |
| DB30 | F11 | Global Const _CONTROLKEY_F11 As Long := &H40000000 |
| DB31 | F12 | Global Const _CONTROLKEY_F12 As Long := &H80000000 |

# OnCollectionMessage

This function is called if a message is sent a collection of objects. Parameters ParamArray can be arbitrary and they are specified by a message sender. All parameters must conform to the agreed meaning of the message. 

#### Syntax 

```visualbasic
Function OnCollectionMessage( 
  msgobject As BaseGraphicClass, 
  messageid As Long, 
  ParamArray)
```

#### Parameters 

msgobject 

BaseGraphicClass. It is the base graphics class. 

messageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id of the message. 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361)</u> They are message parameters. 

# OnDown

This function is called if an event Down is generated. The Down event occurs if a left mouse button or a touch panel is pressed. Coordinates x and y indicate a position of a touch point related to the beginning of the object. If the function returns true the object has taken the event and received the following events **Move** and **Up**. If the function returns false or the function isn't rewritten, the event falls in a downward direction. It means a system calls the **OnDown** function of an object which is displayed underneath. 

#### Syntax 

```visualbasic
Function OnDown( 
  x As Long, 
  y As Long, 
  eventtime As Time) 
As Boolean
```

#### Parameters 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate. 

eventtime 

<u>[Time](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the time of the event. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. The function GetLastError returns the error number. 

# OnDraw

This function is called by the framework to perform a screen display of the object. There is no default implementation which means you must override this function to display your object. In case the function isn't rewritten the object has no graphic representation. Drawing functions are used just in the OnDraw function and in functions called from OnDraw. Otherwise drawing functions do nothing. 

#### Syntax 

```visualbasic
Function OnDraw()
```

# OnHide

This function is called when the object becomes invisible, which means the Hide function is called. 

#### Syntax 

```visualbasic
Function OnHide()
```

# OnJoinMessage

This function is called if a message is sent to a group of objects. Parameters ParamArray can be arbitrary and they are specified by a message sender. All parameters must conform to the agreed meaning of the message. 

#### Syntax 

```visualbasic
Function OnJoinMessage( 
  msgobject As BaseGraphicClass, 
  messageid As Long, 
ParamArray)
```

#### Parameters 

msgobject 

BaseGraphicClass. It is the base graphics class. 

messageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id of the message. 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361)</u> They are message parameters. 

# OnKillFocus

This function is called when the object has lost focus. 

#### Syntax 

```visualbasic
Function OnKillFocus ()
```

# OnMessage

#### This function is called if a message is sent by the function SendMessage. Parameters ParamArray can be arbitrary and they are specified by a message sender. All parameters and return value must conform to the agreed meaning of the message. 

#### Syntax 

```visualbasic
Function OnMessage( 
  messageid As Long, 
  ParamArray)
As Long
```

#### Parameters 

messageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id of the message. 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361)</u> They are message parameters. 

# OnMove

This function is called by an event Move of an object, which returns true in a Down event function. Parameters x and y indicate the relative cursor position at the time of the event Move. The parameter isinside gets true if the cursor position is inside the object. 

#### Syntax 

```visualbasic
Function OnMove( 
  x As Long, 
  y As Long, 
  eventtime As Time, 
  isinside As Boolean)
```

#### Parameters 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate of the cursor. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate of the cursor 

eventtime 

<u>[Time](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the time of the event. 

isinside 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True if the cursor position is inside the object, False otherwise. 

# OnSetFocus

This function is called when the object receives focus. 

#### Syntax 

```visualbasic
Function OnSetFocus ()
```

# OnSetLanguage

This function is called when a function SetLanguage is called. A parameter **languageid** indicates an <u>[id number of the language](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/512983127/General#LanguageId)</u>. 

#### Syntax 

```visualbasic
Function OnSetLanguage(languageid As Long)
```

#### Parameters 

languageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the <u>[id number of the language](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/512983127/General#LanguageId)</u>. 

# OnShow

This function is called when an object becomes visible, which means functions Show or WindowOpen are called without a flag hidden. Typically it is used in combination with the OnHide function to optimize the system load. For example, an object control timer can be started here. 

#### Syntax 

```visualbasic
Function OnShow()
```

# OnTimer

This function is called if an event Timer occurs. This event is invoked if the **StartTimer** function was used. The parameter **timerid** is a number forwarded to the **StartTimer** function. Function **StartTimer** can be used multiple times with different numbers and different timing parameters. This is the method how to use more timers in the same object. The number of available timers is specified with the StartTimer command. 

#### Syntax 

```visualbasic
Function OnTimer(timerid As Long)
```

#### Parameters 

timerid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id number of the timer. 

# OnUp

This function Event Up calls the OnUp function for an object, which returns true in the Down event function. Parameters x and y indicate the relative cursor position at the time of the event Up. The parameter isinside gets true if the cursor position is inside the object. 

#### Syntax 

```visualbasic
Function OnUp( 
  x As Long, 
  y As Long, 
  eventtime As Time, 
  isinside As Boolean)
```

#### Parameters 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate of the cursor. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate of the cursor 

eventtime 

<u>[Time](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the time of the event. 

isinside 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True if the cursor position is inside the object, False otherwise. 

# Redraw

This function initializes redrawing of the entire object or part. Parameters **x**, **y**, **width,** and **height** can specify rectangular part for redrawing. In that case, only a part of the object is redrawn. On the other side, default values mean redrawing the entire object. If flag **immediately** is used (**immediately**=**true**), then redrawing will be done as soon as possible. This function can't be called in the **OnDraw** function. 

#### Syntax 

```visualbasic
Function Redraw( 
  Optional x As Long := 0, 
  Optional y As Long := 0, 
  Optional width As Long := -1, 
  Optional height As Long := -1, 
  Optional immediately As Boolean := False)
```

#### Parameters 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the x coordinate of the rectangular part for redrawing. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. It is the y coordinate of the rectangular part for redrawing. 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the width of the rectangular part for redrawing. If it is -1 by default, the width of the object to redraw is used. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to -1. It is the height of the rectangular part for redrawing. If it is -1 by default, the height of the object to redraw is used. 

immediately 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, defaults to False. It specifies when the redrawing will be done. If it is True, it will be done as soon as possible. If it is False, it will be done when a system will not be under load by On-messages. 

# SendCollectionMessage

This function sends a message to all the graphic objects included in the same graphic module - collection. This function can be applied inside of a public function of a graphic module. For example, it is ideal for discoloration or language settings. Just for the common functionality of all objects included in a collection. Inside a module, it is possible to get a collection number using compiler variable __MODULE_ID. 

#### Syntax 

```visualbasic
Function SendCollectionMessage( 
  sendToMe As Boolean, 
  messageid As Long, 
  ParamArray)
```

#### Parameters 

sendToMe 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> If it is True, the message is sent to all collection objects including the sender object. If it is False, the message is sent to all collection objects except the sender object. 

messageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id number of the message. 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361)</u> They are message parameters. 

# SendJoinMessage

This function sends a message to all graphic objects included in the same group. The function is primarily intended for sending messages between objects in one group. For example, it is ideal for the implementation of a radio button. 

#### Syntax 

```visualbasic
Function SendJoinMessage( 
  sendToMe As Boolean, 
  messageid As Long, 
  ParamArray)
```

#### Parameters 

sendToMe 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> If it is True, the message is sent to all collection objects including the sender object. If it is False, the message is sent to all cocollectionbjects except the sender object. 

messageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id number of the message. 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361)</u> They are message parameters. 

# SendMessage

This function calls the function OnMessage in the graphic object. This function is suitable if you need the same functionality in more graphic classes which are not inherited from the same class. 

#### Syntax 

```visualbasic
Function SendMessage( 
  messageid As Long, 
  ParamArray) 
As Long
```

#### Parameters 

messageid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id number of the message. 

ParamArray 

<u>[ParamArray](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/509149361)</u> They are message parameters. 

#### Example 

Consider that you need to set background color in all graphic objects on the window but you don’t know the type of the graphic object. There may be instances of MyEditBox or instances of MyButton or instances of other classes. But you know that all graphic classes have the same functionality in the function OnMessage for messageid 2000.  

```visualbasic
Private Process Autoexec() 
  Var count As Long := MyFullscreenWindow1.MyGetChildCount() 
  Var instance As AddressOf BaseGraphicClass 
  Var i As Long 

  MyFullscreenWindow1.ShowObject() 
    For i := 1 To count  
      instance := MyFullscreenWindow1.MyGetChild(i) 
      instance.SendMessage(2000,_COLOR_BLUE) 
    End For  
End Process
```

First graphic collection with MyButton class 

```visualbasic
GraphicClass MyBaseButton Inherits BaseGraphicClass 
End GraphicClass 

Global GraphicClass MyButton Inherits MyBaseButton 
  Private Var backgroundColor As Long := _COLOR_RED 

  Protected Function OnMessage( messageid As Long, ParamArray) As Long 
    Select messageid 
      Case 2000 
        If ParamArrayCount  = 1 Then  
          backgroundColor := VariableOf ParamArray[1] 
          Redraw() 
          Return Value 1 
        Else  
          Return Value 0 
        End If 
    End Select 
    Return Value 0  
  End Function 
End GraphicClass
```

Second graphic collection with MyEditBox class 

```visualbasic
GraphicClass MyBaseEditBox Inherits BaseGraphicClass 
End GraphicClass 

Global GraphicClass MyEditBox Inherits MyBaseEditBox 
  Private Var backgroundColor As Long := _COLOR_RED 

  Protected Function OnMessage( messageid As Long, ParamArray) As Long 
    Select messageid 
      Case 2000 
        If ParamArrayCount = 1 Then  
          backgroundColor := VariableOf ParamArray[1] 
          Redraw() 
          Return Value 1 
        Else  
          Return Value 0 
        End If 
    End Select 
    Return Value 0 
  End Function 
End GraphicClass
```

# SetFocus

This function set the focus for receiving hardware keyboard events on the pcCUE or ipCUE omega. Use this function inside the edit graphic object for example in the function OnDown. 

#### Syntax 

```visualbasic
Function SetFocus ()
```

# SetPosition

This function sets a position of the left top corner to point (x, y). Returns true if the position was set. The Redraw function is automatically executed after the function SetPosition is called. 

#### Syntax 

```visualbasic
Function SetPosition( 
  x As Long, 
  y As Long) 
As Boolean
```

#### Parameters 

x 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the x coordinate of the left top corner. 

y 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the y coordinate of the left top corner. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. The function GetLastError returns the error number. 

# SetSize

This function sets an object’s size in pixels. It returns true if the size was set. The Redraw function is automatically executed after the function SetSize is called. 

#### Syntax 

```visualbasic
Function SetSize( 
  width As Long, 
  height As Long) 
As Boolean
```

#### Parameters 

width 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the width. 

height 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the height. 

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. The function GetLastError returns the error number. 

# Show

This function enables the display of the object. Calling this function causes an event Show and it calls the OnShow function. The Redraw function is automatically executed after the function Show is called. 

#### Syntax 

```visualbasic
Function Show()
```

# StartTimer

This function starts a timer with a number **timerid**. This number must be positive integral and it is transferred to the **OnTimer** function. The counter is normally single mode (non-periodic). That means if it is to be called repeatedly, it must be called to the **StartTimer** function (in the **OnTimer** function) with the same **timerid** and the same pulse time (parameter **lifetime**). The timer can be started in periodic mode using the flag **_TIMER_PERIODIC**. 

#### Syntax 

```visualbasic
Function StartTimer( 
  timerid As Long, 
  lifetime As Time, 
  Optional timerflags As Long := 0)
As Boolean
```

#### Parameters 

timerid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id number of the timer from 1 to 4. Every object can have a maximum of 4 timers. If a value outside the range 1-4 is entered, the function returns False. 

lifetime 

<u>[Time](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Time)</u> It is the count time. 

timerflags 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> Optional, defaults to 0. They are timer flags. The parameter is a bit mask. Predefined constants for timerflags are as follows: 

|  |  |  |
| --- | --- | --- |
| Name | Value | Description |
| _TIMER_PERIODIC | &H80000000 | Timer is running in periodic mode. That means the timer automatically reactivates each time the period elapses until the timer is canceled using the StopTimer function. If this bit isn't set, then the timer must be re-started every time when period elapses. |
| _TIMER_PAUSEIFHIDDEN | &H40000000 | If this flag is set, the timer is running only if the object is active. That means if window included objects are open, all parent objects are visible and if the object itself is visible. The timer is automatically suspended if object is not active. If this flag is not set, the timer runs independently of the visibility of the object. |

#### Return value 

<u>[Boolean](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> It is True on success or False if an error occurs. The function GetLastError returns the error number. 

# StopTimer

This function allows the stopping of running timer before OnTimer event. Parameter **timerid** must be the same number as a number used in the **StartTimer** function. If zero is used as **timerid** then all timers are stopped. 

#### Syntax 

```visualbasic
Function StopTimer(timerid As Long)
```

#### Parameters 

timerid 

<u>[Long](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the id number of the timer.