mvm_gui_send_image — Send an image to a webclient.
mvm_gui_send_image(Image : : ServerHandle, ConnectionHandle, Id : )
Sends an image in Image via a server specified by ServerHandle to a connected webclient specified by ConnectionHandle.
Multiple connections can be specified as tuple. A ConnectionHandle with the value 'all' means that the message is sent to all connected clients and is the default. A value of 'first' addresses only the first connection. Additionally, an optional custom error handling can be specified in ConnectionHandle.
For further explanations on connection handles and custom error handling, see the MachineVisionMakers / HDevGUI chapter documentation for this extension package.
The message ID by which the message will be received on client side has to be given in Id. The ID must be a valid C identifier which consists of letters, digits, and underscores and must start with a letter or underscore.
The web client can use the HTML code similar to the following to visualize the image:
<canvas id="canvas1" data-bind="canvas1"></canvas>
Image (input_object) image(-array) → object
The image to be sent
ServerHandle (input_control) serial → (handle)
GUI server handle
ConnectionHandle (input_control) socket(-array) → (handle / string)
The destination connection handle
Default value: 'all'
List of values: 'ack_error_ignore', 'ack_error_lowlevel', 'ack_error_raise', 'all', 'connection_error_ignore', 'connection_error_lowlevel', 'connection_error_raise', 'first'
Id (input_control) proc_name → (string)
message ID
Foundation