dump_window ( : : WindowHandle, Device, FileName : )

Write the window content to a file.

dump_window writes the content of the window to a file. You may continue to process this file by convenient printers or other programs. The content of a display is prepared for each special device (Device), i.e., it is formated in a manner, that you may print this file directly or it can be processed furthermore by a graphical program.

To transform gray values the current color table of the window is used, i.e., the values of set_lut_style remain unconsidered.

Possible values for Device 'postscript' PostScript - file. Filetermination: <FileName>.ps ['postscript',Width,Height] PostScript - file with specification of the output size. $Width$ and $Height$ refer to the size. File extension: <FileName>.ps 'tiff' TIFF - file, 1 byte per pixel incl. current color table or 3 bytes per sample (dependent on VGA card), uncompressed. File extension: <FileName>.tiff 'bmp' Windows-BMP format, RGB image, 3 bytes per pixel. The color resolution pendends on the VGA card. File extension: <FileName>.bmp 'jpeg' JPEG format, with lost of information; together with the format string the quality value determining the compression rate can be provided: e.g., 'jpeg 30'. 'png': PNG format (lossless compression); together with the format string, a compresion level between 0 and 9 can be specified, where 0 corresponds to no compression and 9 to the best possible compression. Alternatively, the compression can be selected with the following strings: 'best', 'fastest', and 'none'. Hence, examples for correct parameters are 'png', 'png 7', and 'png none'. Images of type byte and uint2 can be stored in PNG files. If an image with a reduced domain is written, the region is stored as the alpha channel, where the points within the domain are stored as the maximum gray value of the image type and the points outside the domain are stored as the gray value 0. If an image with a full domain is written, no alpha channel is stored.


Attention

Under UNIX, the graphics window must be completely visible on the root window, because otherwise the contents of the window cannot be read due to limitations in X Windows. If larger graphical displays are to be written to a file, the window type 'pixmap' can be used.


Parameters

WindowHandle (input_control)
window -> integer
Window identifier.

Device (input_control)
string(-array) -> string / integer
Name of the target device or of the graphic format.
Default value: 'postscript'
List of values: 'postscript', 'tiff', 'bmp', 'jpeg', 'png', ''jpeg 100'', ''jpeg 80'', ''jpeg 60'', ''jpeg 40'', ''jpeg 20'', ''png best'', ''png fastest'', ''png none''

FileName (input_control)
filename -> string
File name (without extension).
Default value: 'halcon_dump'


Example
/* PostScript - Dump von Bild und eingeblendeten Regionen: */
disp_image(Image,WindowHandle) 
set_colored(WindowHandle,12) 
disp_region(Regions,WindowHandle) 
dump_window(WindowHandle,'postscript','/tmp/halcon_dump') 
system_call('lp -d ps /tmp/halcon_dump.ps').

Result

If the appropriate window is valid and the specified parameters are correct dump_window returns 2 (H_MSG_TRUE). If necessary an exception handling is raised.


Parallelization Information

dump_window is reentrant, local, and processed without parallelization.


Possible Predecessors

open_window, set_draw, set_color, set_colored, set_line_width, open_textwindow, disp_region


Possible Successors

system_call


See also

open_window, open_textwindow, set_system, dump_window_image


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH