ClassesClasses | | Operators

flush_bufferT_flush_bufferFlushBufferFlushBuffer (Operator)

Name

flush_bufferT_flush_bufferFlushBufferFlushBuffer — 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()

Description

flush_bufferflush_bufferFlushBufferFlushBufferFlushBuffer flushes the contents of the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle.

flush_bufferflush_bufferFlushBufferFlushBufferFlushBuffer 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_paramSetWindowParamSetWindowParamSetWindowParam. If 'flush'"flush""flush""flush""flush" is 'false'"false""false""false""false" all display operations (such as disp_objdisp_objDispObjDispObjDispObj or disp_textdisp_textDispTextDispTextDispText) are redirected to a buffer and have no effect on WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (this applies for all window modes). flush_bufferflush_bufferFlushBufferFlushBufferFlushBuffer copies the contents of this buffer to the window WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle.

This is very useful to avoid flickering by batching several display operations (e.g. a clear_windowclear_windowClearWindowClearWindowClearWindow followed by a disp_objdisp_objDispObjDispObjDispObj) and displaying the final result with flush_bufferflush_bufferFlushBufferFlushBufferFlushBuffer.

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

Attention

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

Execution Information

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHtuple (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_bufferFlushBufferFlushBufferFlushBuffer returns 2 (H_MSG_TRUE).

Possible Predecessors

disp_objdisp_objDispObjDispObjDispObj

Possible Successors

dump_window_imagedump_window_imageDumpWindowImageDumpWindowImageDumpWindowImage

See also

set_window_paramset_window_paramSetWindowParamSetWindowParamSetWindowParam

Module

Foundation


ClassesClasses | | Operators