Skip to content

flush_bufferFlushBufferFlushBufferflush_bufferT_flush_buffer🔗

Short description🔗

flush_bufferFlushBufferFlushBufferflush_bufferT_flush_buffer — Flush the contents of a window.

Signature🔗

flush_buffer( window WindowHandle )void FlushBuffer( const HTuple& WindowHandle )static void HOperatorSet.FlushBuffer( HTuple windowHandle )def flush_buffer( window_handle: HHandle ) -> None

Herror T_flush_buffer( const Htuple WindowHandle )

void HWindow::FlushBuffer( ) const

void HWindow.FlushBuffer( )

Description🔗

flush_bufferFlushBuffer flushes the contents of the window WindowHandlewindowHandlewindow_handle.

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

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

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

Attention🔗

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

Execution information🔗

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🔗

WindowHandlewindowHandlewindow_handle (input_control) window → (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (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_bufferFlushBuffer returns 2 (H_MSG_TRUE).

Combinations with other operators🔗

Combinations

Possible predecessors

disp_objDispObj

Possible successors

dump_window_imageDumpWindowImage

See also

set_window_paramSetWindowParam

Module🔗

Foundation