Operator Reference

dump_windowT_dump_windowDumpWindowDumpWindowdump_window (Operator)

dump_windowT_dump_windowDumpWindowDumpWindowdump_window — Write the window content to a file.

Signature

dump_window( : : WindowHandle, Device, FileName : )

Herror T_dump_window(const Htuple WindowHandle, const Htuple Device, const Htuple FileName)

void DumpWindow(const HTuple& WindowHandle, const HTuple& Device, const HTuple& FileName)

void HWindow::DumpWindow(const HTuple& Device, const HString& FileName) const

void HWindow::DumpWindow(const HString& Device, const HString& FileName) const

void HWindow::DumpWindow(const char* Device, const char* FileName) const

void HWindow::DumpWindow(const wchar_t* Device, const wchar_t* FileName) const   ( Windows only)

static void HOperatorSet.DumpWindow(HTuple windowHandle, HTuple device, HTuple fileName)

void HWindow.DumpWindow(HTuple device, string fileName)

void HWindow.DumpWindow(string device, string fileName)

def dump_window(window_handle: HHandle, device: MaybeSequence[Union[str, int]], file_name: str) -> None

Description

dump_windowdump_windowDumpWindowDumpWindowdump_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 (DeviceDeviceDevicedevicedevice), i.e., it is formatted 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.

Possible values for DeviceDeviceDevicedevicedevice

'postscript':

PostScript - file. File extension: '.ps'

'postscript',Width,Height:

PostScript - file with specification of the output size. Width and Height refer to the size. In this case a tuple with three values as DeviceDeviceDevicedevicedevice is passed.

File extension: '.ps'

'tiff':

TIFF format; Compression is possible with Adobe deflate compression ('deflate [num]'"deflate [num]""deflate [num]""deflate [num]""deflate [num]", lossless), JPEG ('jpeg [num]'"jpeg [num]""jpeg [num]""jpeg [num]""jpeg [num]", lossy), LZW ('lzw'"lzw""lzw""lzw""lzw", lossless), and PackBits ('packbits'"packbits""packbits""packbits""packbits", lossless). Here, '[num]'"[num]""[num]""[num]""[num]" denotes an optional specification of a compression parameter. For 'deflate'"deflate""deflate""deflate""deflate", a number between 0 (no compression) and 9 (maximum compression) can be specified. For 'jpeg'"jpeg""jpeg""jpeg""jpeg", a number between 0 and 100 can be specified. The semantics are identical to the semantics of 'jpeg' described below. The different options can be accumulated by appending them separated by a space character. Examples: 'tiff deflate 9'"tiff deflate 9""tiff deflate 9""tiff deflate 9""tiff deflate 9": Maximum Adobe deflate compression; 'tiff jpeg 90'"tiff jpeg 90""tiff jpeg 90""tiff jpeg 90""tiff jpeg 90": JPEG compression with high quality; 'tiff lzw'"tiff lzw""tiff lzw""tiff lzw""tiff lzw": LZW compression; 'tiff'"tiff""tiff""tiff""tiff" or 'tiff none'"tiff none""tiff none""tiff none""tiff none": no compression.

File extension: '.tif'

'bmp':

Windows-BMP format, RGB image, 3 bytes per pixel. The color resolution depends on the VGA card.

File extension: '.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'.

File extension: '.jpg'

'jpegxr':

JPEG-XR format (lossless and lossy compression); together with the format string the quality value determining the compression rate can be provided: e.g., 'jpegxr 30'.

File extension: '.jxr'

'jp2':

JPEG2000 format (lossless and lossy compression); together with the format string the quality value determining the compression rate can be provided (e.g., 'jp2 40'). This value corresponds to the ratio of the size of the compressed image and the size of the uncompressed image (in percent). As lossless JPEG2000 compression reduces the file size significantly already, only smaller values (typically smaller than 50) influence the file size. Is no value provided (and only then), the image is compressed without loss.

File extension: '.jp2'

'png':

PNG format (lossless compression); together with the format string, a compression 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'.

File extension: '.png'

Attention

Under Unix-like systems, 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'"pixmap""pixmap""pixmap""pixmap" can be used.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

DeviceDeviceDevicedevicedevice (input_control)  string(-array) HTupleMaybeSequence[Union[str, int]]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Name of the target device or of the graphic format.

Default: 'postscript' "postscript" "postscript" "postscript" "postscript"

Suggested values: 'postscript'"postscript""postscript""postscript""postscript", 'tiff'"tiff""tiff""tiff""tiff", 'tiff deflate 9'"tiff deflate 9""tiff deflate 9""tiff deflate 9""tiff deflate 9", 'tiff jpeg 90'"tiff jpeg 90""tiff jpeg 90""tiff jpeg 90""tiff jpeg 90", 'tiff lzw'"tiff lzw""tiff lzw""tiff lzw""tiff lzw", 'tiff packbits'"tiff packbits""tiff packbits""tiff packbits""tiff packbits", 'bmp'"bmp""bmp""bmp""bmp", 'jpeg'"jpeg""jpeg""jpeg""jpeg", 'jpeg 100'"jpeg 100""jpeg 100""jpeg 100""jpeg 100", 'jpeg 80'"jpeg 80""jpeg 80""jpeg 80""jpeg 80", 'jpeg 60'"jpeg 60""jpeg 60""jpeg 60""jpeg 60", 'jpeg 40'"jpeg 40""jpeg 40""jpeg 40""jpeg 40", 'jpeg 20'"jpeg 20""jpeg 20""jpeg 20""jpeg 20", 'jpegxr'"jpegxr""jpegxr""jpegxr""jpegxr", 'jpegxr 50'"jpegxr 50""jpegxr 50""jpegxr 50""jpegxr 50", 'jpegxr 40'"jpegxr 40""jpegxr 40""jpegxr 40""jpegxr 40", 'jpegxr 30'"jpegxr 30""jpegxr 30""jpegxr 30""jpegxr 30", 'jpegxr 20'"jpegxr 20""jpegxr 20""jpegxr 20""jpegxr 20", 'jp2'"jp2""jp2""jp2""jp2", 'jp2 50'"jp2 50""jp2 50""jp2 50""jp2 50", 'jp2 40'"jp2 40""jp2 40""jp2 40""jp2 40", 'jp2 30'"jp2 30""jp2 30""jp2 30""jp2 30", 'jp2 20'"jp2 20""jp2 20""jp2 20""jp2 20", 'png'"png""png""png""png", 'png best'"png best""png best""png best""png best", 'png fastest'"png fastest""png fastest""png fastest""png fastest", 'png none'"png none""png none""png none""png none"

FileNameFileNameFileNamefileNamefile_name (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name (without extension).

Default: 'halcon_dump' "halcon_dump" "halcon_dump" "halcon_dump" "halcon_dump"

Example (HDevelop)

dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'fabrik')
gen_circle (Circle, 200, 200, 100.5)
dev_display (Image)
dev_display (Circle)
dump_window(WindowHandle,'postscript','halcon_dump')

Example (C)

/* PostScript - Dump of Image and Regions */
disp_image(Image,WindowHandle);
set_colored(WindowHandle,12);
disp_region(Regions,WindowHandle);
dump_window(WindowHandle,"postscript","halcon_dump");

Example (HDevelop)

dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'fabrik')
gen_circle (Circle, 200, 200, 100.5)
dev_display (Image)
dev_display (Circle)
dump_window(WindowHandle,'postscript','halcon_dump')

Example (HDevelop)

dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'fabrik')
gen_circle (Circle, 200, 200, 100.5)
dev_display (Image)
dev_display (Circle)
dump_window(WindowHandle,'postscript','halcon_dump')

Result

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

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowopen_window, set_drawset_drawSetDrawSetDrawset_draw, set_colorset_colorSetColorSetColorset_color, set_coloredset_coloredSetColoredSetColoredset_colored, set_line_widthset_line_widthSetLineWidthSetLineWidthset_line_width, disp_regiondisp_regionDispRegionDispRegiondisp_region

Possible Successors

system_callsystem_callSystemCallSystemCallsystem_call

See also

open_windowopen_windowOpenWindowOpenWindowopen_window, set_systemset_systemSetSystemSetSystemset_system, dump_window_imagedump_window_imageDumpWindowImageDumpWindowImagedump_window_image

Module

Foundation