4.13   Opening the Graphics Window

Up until now, the visualization of iconic results relied on the fact that a graphics window is always opened by default when HDevelop starts. If you need control over the size and position of graphics windows you can explicitly open a distinct number of floating graphics windows.

Add the following lines before the first line of your program:

  dev_close_window ()
  dev_open_window (0, 0, 512, 512, 'black', WindowHandle)

The first line closes a floating graphics window potentially left over from a previous run to ensure a consistent state at the start of the program. The second line opens a single graphics window that can be referenced by the output variable WindowHandle. The window handle is a magic value that is also displayed in the title bar of the corresponding graphics window.

Graphics windows that are opened via operator dev_open_window will be opened as floating windows, displaying images in Full Stretch mode for maximum backwards compatibility.

Generating Code for the Settings of a Graphics Window

You can use the Insert Code... command to insert the piece of code into the current program that will restore the current state of the graphics window or parts of it.

  1. Prepare the state of the graphics window to use. For more information, see section “Graphics Window”.

  2. In the program window, place the cursor where you want to insert the code.

  3. Click VisualizationInsert Code....

  4. In the dialog, specify the settings to add:

    Iconic objects from the graphics stack  
     

    All iconic objects that are currently visible in the active graphics window

    Visualization parameters  
     

    The draw colors, draw mode, line width, region shape, LUT, and paint mode

    Window geometry  
     

    The window size and the visible part

  5. Click Insert.