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_bufferFlushBufferFlushBufferflush_buffer flushes the contents of the window WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle.

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

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

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

Attention

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

Execution Information

Parameters

WindowHandleWindowHandleWindowHandlewindowHandlewindow_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_bufferFlushBufferFlushBufferflush_buffer returns 2 ( H_MSG_TRUE) .

Possible Predecessors

disp_objdisp_objDispObjDispObjdisp_obj

Possible Successors

dump_window_imagedump_window_imageDumpWindowImageDumpWindowImagedump_window_image

See also

set_window_paramset_window_paramSetWindowParamSetWindowParamset_window_param

Module

Foundation