Viewer
If you use the simulation when debugging your application, you cannot see the display output when stepping through the source code. The primary purpose of the viewer is to solve this problem. It shows the contents of the simulated display(s) while debugging in the simulation.
The viewer gives you the following additional capabilities:
- Multiple windows for each layer.
- Watching the whole virtual layer in one window.
- Magnification of each layer window.
- Composite view if using multiple layers.
Using the viewer
The viewer allows you to:
- Open multiple windows for any layer/display.
- Zoom in on any area of a layer/ display.
- See the contents of the individual layers/displays as well as the composite view in multilayer configurations.
- See the contents of the virtual screen and the visible display when using the virtual screen support.

The screenshot shows the viewer displaying the output of a single layer configuration. The upper left corner shows the simulated display. In the upper right corner is a window, which shows the available colors of the display configuration. At the bottom of the viewer a second display window shows a magnified area of the simulated display. If you start to debug your application, the viewer shows one display window per layer and one color window per layer. In a multilayer configuration, a composite view window will also be visible.
Using the simulation and the viewer
If you use the simulation when debugging your application, you cannot see the display output when stepping through the source code. This is due to a limitation of Win32: If one thread (the one being debugged) is halted, all other threads of the process are also halted. This includes the thread which outputs the simulated display on the screen.
The emWin viewer solves this problem by showing the display window and the color window of your simulation in a separate process. It is your choice if you want to start the viewer before debugging your application or while you are debugging. Our suggestion:
- Step 1: Start the viewer. No display- or color window is shown until the simulation has been started.
- Step 2: Open the Visual C++ workspace.
- Step 3: Compile and run the application program.
- Step 4: Debug the application as described previously.
The advantage is that you can now follow all drawing operations step by step in the LCD window.
Using the viewer with virtual pages
By default the viewer opens one window per layer which shows the visible part of the video RAM, normally the display. If the configured virtual video RAM is larger than the display, the command View/Virtual Layer/Layer (0...4) can be used to show the whole video RAM in one window. When using the function GUI_SetOrg(), the contents of the visible screen will change, but the virtual layer window remains unchanged:

For more information about virtual screens, refer to the section “Virtual Screen Support”.
Always on top
Per default the viewer window is always on top. You can change this behavior by selecting Options\Always on top from the menu.
Open further windows of the display output
If you want to show a magnified area of the LCD output or the composite view of a multi layer configuration it could be useful to open more than one output window. You can do this by View/Visible Layer/Layer (1...4), View/Virtual Layer/
Layer (1...4) or View/Composite.
Zooming
Zooming in or out is easy:
Right-click on a layer or composite window opens the Zoom popup menu.
Choose one of the zoom options:

Using the grid

If you magnify the LCD output >= 300%, you have the choice between showing the output with or without a grid. It is possible to change the color of the grid. This can be done choosing the Menu point Options/Grid color.
Adapting the size of the window
If you want to adapt the size of the window to the magnification choose Fit window to size from the first popup menu.
Copy the output to the clipboard
Click onto a LCD window or a composite view with the right mouse key and choose Copy to clipboard. Now you can paste the contents of the clipboard for example into the mspaint application.
Using the viewer with multiple displays
If you are working with multiple displays you should set the viewer into ’Multi display mode’ by using the command Options/Multi layer/display.

When starting the debugger the viewer will open one display window and one color
window for each display:
Using the viewer with multiple layers
If you are working with multiple layers you should set the viewer into ’Multi layer mode’ by using the command Options/Multi layer/display.

When starting the debugger the viewer will open one LCD window and one color window for each layer and one composite window for the result.
Example
The example below shows a screenshot of the viewer with 2 layers. Layer 0 shows color bars with a high color configuration. Layer 1 shows a transparent circle on a white background with colored rectangles. The composite window shows the result which is actually visible on the display:

Transparency
The composite window of the viewer shows all layers; layers with higher index are on
top of layers with lower index and can have transparent pixels:

Viewer
