CHAPTER 2 - MACROS AND VISUAL BASIC
ZEISS
Example Macros
ELYRA 7
18
000000-2262-999
03/2019 V_02
7
Example Macros
This library of example macros is designed as a starting point for your own programming ventures. They
are deliberately kept simple for quick understanding and hand-on. We recommend that you create copies
the macros and then edit them to see how ZEN reacts to your commands.
You can find the macros in ZEN\Macros\ExamplesMacros.
7.1
Access to images
This macro demonstrates how to access the pixel values of an existing image.
[C:\ZEN\Macros\ExamplesMacros\access_to_images.lvb]
7.2
Backup recording settings
This macro demonstrates how to backup the acquisition settings and then later change the settings back
to the original ones.
[C:\ZEN\Macros\ExampleMacros\backup_recording.lvb]
7.3
Event handling
Events can be used to react to actions by the user or by the hardware. Typically, events in ZEN are either
•
Mouse events
•
Scan state events
•
Hardware events
This macro shows how to react to mouse events in a VBA macro.
[C:\ZEN\Macros\ExampleMacros\CaptureMouseEvents.lvb]
7.4
Export, Save and Load
This example demonstrates how to export an image (as TIFF), save it (in the CZI format), and load it (from
CZI and TIFF). It can be easily adopted to other file formats.
[C:\ZEN\Macros\ExampleMacros\Export_Save_and_Load.lvb]
7.5
VBA-GUI API
We have not created example macros for the VBA-GUI API, because these can easily be generated by the
macro recorder functionality. Activate macro recording and the execute the actions that you want to
automate. Then edit the script to suit your needs.
Note: If you are afraid of working with an online-system, you can also record and edit macros in the ZEN
Demo mode.