flush_bufferT_flush_bufferFlushBufferFlushBufferflush_buffer (Operator)

Name

flush_bufferT_flush_bufferFlushBufferFlushBufferflush_buffer — Flush the contents of a window.

Signature

flush_buffer( : : WindowHandle : )

Herror T_flush_buffer(const Htuple WindowHandle)

void FlushBuffer(const HTuple& WindowHandle)

void HWindow::FlushBuffer() const

static void HOperatorSet.FlushBuffer(HTuple windowHandle)

void HWindow.FlushBuffer()

def flush_buffer(window_handle: HHandle) -> None

Description

flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer flushes the contents of the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle.

flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer is only necessary if the window parameter 'flush'"flush""flush""flush""flush""flush" has been set to 'false'"false""false""false""false""false" with set_window_paramset_window_paramSetWindowParamSetWindowParamSetWindowParamset_window_param. If 'flush'"flush""flush""flush""flush""flush" is 'false'"false""false""false""false""false" all display operations (such as disp_objdisp_objDispObjDispObjDispObjdisp_obj or disp_textdisp_textDispTextDispTextDispTextdisp_text) are redirected to a buffer and have no effect on WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (this applies for all window modes). flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer copies the contents of this buffer to the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle.

This is very useful to avoid flickering by batching several display operations (e.g., a clear_windowclear_windowClearWindowClearWindowClearWindowclear_window followed by a disp_objdisp_objDispObjDispObjDispObjdisp_obj) and displaying the final result with flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer.

This does not apply to drawing objects, which are always updated.

Attention

flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer depends on the library libcanvas, which might not be available on embedded systems.

Execution Information

Parameters

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

Window handle.

Example (HDevelop)

read_image (Image, 'printer_chip/printer_chip_01')
threshold (Image, Region, 128, 255)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
set_window_param (WindowHandle, 'flush', 'false')
dev_display (Image)
dev_display (Region)
disp_text (WindowHandle, 'Result of threshold', 'window', \
           12, 12, 'black', [], [])
* nothing is displayed until flush_buffer is called
flush_buffer (WindowHandle)

Result

If the window exists flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer returns TRUE.

Possible Predecessors

disp_objdisp_objDispObjDispObjDispObjdisp_obj

Possible Successors

dump_window_imagedump_window_imageDumpWindowImageDumpWindowImageDumpWindowImagedump_window_image

See also

set_window_paramset_window_paramSetWindowParamSetWindowParamSetWindowParamset_window_param

Module

Foundation