Back to Aurora Vision Library website

You are here: Start » Function Reference » Debug Preview » CreateView

CreateView


Header: AVL.h
Namespace: avl::DebugPreview
Module: FoundationLite

Creates a new floating window for a 2D image based data preview.

Applications: This function is for development purpose only and requires Library Professional license.

Syntax

avl::DebugPreview::ViewHandle avl::DebugPreview::CreateView
(
	const atl::String& name,
	int width = -1,
	int height = -1,
	int posX = -1,
	int posY = -1
)

Parameters

Name Type Default Description
name const String& Window title.
width int -1 Width of the window preview area in pixels.
height int -1 Height of the window preview area in pixels.
posX int -1 X coordinate of the initial window position.
posY int -1 Y coordinate of the initial window position.

Description

The debug preview system helps in debugging of Aurora Vision Library based applications by providing a quick but primitive way to preview internal application image-oriented data in floating windows.

This function initializes the preview subsystem and opens a new floating preview window for displaying 2D images and primitives. It is possible to open up to 32 preview windows at once (have up to 32 active preview handles). The user can interact with the preview by moving or resizing the window, zooming and moving the preview content (with mouse and the mouse scroll-wheel) or setting the preview into various modes through the context menu (by right clicking the preview content).

The name function argument specifies the caption of the new window.

The width and height arguments specify the size of the preview content area of the window in pixels. The arguments are optional and can be omitted to use the default window size (the user can resize the window manually).

The posX and posY arguments specify the initial position of the upper left corner of the window in desktop coordinates. The arguments are optional and can be left on its default values (-1) to automatically arrange the preview window initial layout starting at the top left corner of the desktop.

A preview window will be closed as a result of the following actions:

  • the user manually closes the window (view handle remains valid),
  • CloseView is called on the view handle,
  • CloseAll is called.

This function creates a background thread with a message pump (single thread shared by all windows in the debug preview subsystem) that will stay active till the application closes (even when there are no more windows active). To explicitly close the debug preview subsystem and free its resources call the CloseAll function.

Return value

After successful execution this function returns a handle of the preview (of type avl::DebugPreview::ViewHandle). This handle can be used with SetViewImage and SetViewPrimitive functions to set data into the preview, and with WaitForViewClose to wait for the user to close the window (to help with step-by-step debugging).

This handle needs to be explicitly released with CloseView or WaitForViewClose functions to release its resources (even when the user closes the window manually).

See Also

  • CloseView – Closes a floating preview window.