---
title: "ModifiablePicture (_ModifiablePicture class)"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518914071/ModifiablePicture%20(_ModifiablePicture%20class)"
format: markdown
---
> Macro (toc)

---

Class _ModifiablePicture inherits function from class [https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518881401) and adds the following functions.


# CreateFromSVGByteString

This function creates an image from SVG data that is stored in a ByteString. This function is supported only in signCUE-two.

#### Syntax 

```visualbasic
Function CreateFromSVGByteString(
  svgdatainutf8 As ByteString, 
  Optional width As Long := -1,
  Optional height As Long := -1,
  Optional languageid As Long := _LANGUAGE_DEFAULT) 
As Boolean
```

#### Parameters 

svgdatainutf8

<u>[ByteString](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958)</u>. It is SVG data. 

width

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

height

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

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>. 

#### 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 <u>[GetLastError](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number. 

#### Example 

```visualbasic
// module level 
Var pic As _ModifiablePicture 
Var SVGdata As ByteString := &S"<?xml version=\"1.0\" encoding=\"utf-8\"?><svg version=\"1.1\" id=\"link\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16\" height=\"10\" viewBox=\"0 0 16 10\"><style type=\"text/css\">.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#727272;} </style><polygon Class=\"st0\" points=\"16,10 14,10 14,2 0,2 0,0 16,0 \"/></svg>"
Process Autoexec() 
  pic.CreateFromSVGByteString(SVGdata,160,100) 
End Process
```

# CreateFromSVGFile

This function creates an image from SVG data that is stored in a file. This function is supported only in signCUE-two.

#### Syntax 

```visualbasic
Function CreateFromSVGFile(
  filenameurl As Text, 
  Optional width As Long := -1,
  Optional height As Long := -1,
  Optional languageid As Long := _LANGUAGE_DEFAULT) 
As Boolean
```

#### Parameters 

filenameurl 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/518914071)</u>. it is the source picture filename in SVG format. Function supports reading a SVG picture from the filestorage. The filenameurl must be in the followed format: /filestorage/[subfolders/]picturefilename

width

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

height

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

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>. 

#### 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 <u>[GetLastError](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number. 

#### Example 

```visualbasic
// module level 
Var pic As _ModifiablePicture 
Process Autoexec() 
  pic.CreateFromSVGFile("/filestorage/anypicture.svg",160,100) 
End Process
```


# CreateQRCodeWithTextMessage

This function encodes an entered text message into a QR code picture. 

#### Syntax 

```visualbasic
Function CreateQRCodeWithTextMessage(
  textmessage As Text, 
  sidelength As Long) 
As Boolean
```

#### Parameters 

textmessage 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u>. It is the text message which is encoded into a QR code picture. 

sidelength 

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

#### 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 <u>[GetLastError](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number. 

#### Example 

```visualbasic
// module level 
Var picWithQRCode As _ModifiablePicture 

Process Autoexec() 
  picWithQRCode.CreateQRCodeWithTextMessage("Some text message.",300) 
End Process
```

# ReadFromByteString

This function is dedicated for reading a picture from a ByteString. Only PNG and JPG formats are supported. The variable of that type must be declared in the data segment and cannot be declared as an addressof type. The variable cannot be declared as a local variable of the function. But – it can be used as a parameter of the function. See the example below. 

> ℹ️ The function is supported since firmware 21.40

#### Syntax 

```visualbasic
Function ReadFromByteString(
  data As ByteString, 
  Optional languageid As Long := _LANGUAGE_DEFAULT) 
As Boolean
```

#### Parameters 

data 

<u>[ByteString](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#ByteString)</u>. it is the source picture data in PNG or JPG format. 

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>. 

#### 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 <u>[GetLastError](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number. 

# ReadFromFile

This function is dedicated for reading a picture from the file in the **filestorage** directory or from the **HTTP/HTTPS server**. Only PNG and JPG formats are supported. The variable of that type must be declared in the data segment and cannot be declared as an addressof type. The variable cannot be declared as a local variable of the function. But – it can be used as a parameter of the function. See the example below. 

#### Syntax 

```visualbasic
Function ReadFromFile(
  filenameurl As Text, 
  Optional languageid As Long := _LANGUAGE_DEFAULT) 
As Boolean
```

#### Parameters 

filenameurl 

<u>[Text](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/495058958/Data+types#Text)</u>. it is the source picture filename in PNG or JPG format. 

- Reading a picture from the filestorage

The filenameurl must be in the followed format: 

/filestorage/[subfolders/]picturefilename

- Reading a picture from a http/https server

The filenameurl must be in the followed format:  scheme://[username:password@]servername[:port]path[?query] 

http and https are supported schemes. If no port is specified, it is selected by the scheme automatically (for the http scheme is default port 80, and the https scheme is default port 443). Path and query part in URL must be encoded if it is necessary. If http/https requires basic authentication, also specify username and password in filenameurl.

- Examples of filenameurl

|  |  |
| --- | --- |
| /filestorage/mypicture.png | reading a picture from filestorage |
| http://myservername.com/mypicture.png | reading a picture from a http server |
| https://myservername.com/mypicture.png | reading a picture from a https server |
| https://myname:mypassword@myservername.com/mypicture.png | reading a picture from a HTTPS server which requires Basic authentication |


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>. 

#### 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 <u>[GetLastError](https://cue.atlassian.net/wiki/spaces/CVCHELP/pages/510525445/Command+errors#GetLastError)</u> returns the error number. 

#### Example 

```visualbasic
// module level 
Var picBackground As _ModifiablePicture 

Process Autoexec() 
  // direct read picture 
  picBackground.ReadFromFile("/filestorage/Background.png") 
  // another possibility with using of the function 
  LoadPictureFromFile(picBackground, "/filestorage/Background.png") 
End Process 

Function LoadPictureFromFile(pic As _ModifiablePicture, filename As Text) 
  pic.ReadFromFile(filename) 
End Function
```