Operator Reference
flush_buffer (Operator)
flush_buffer
— Flush the contents of a window.
Signature
flush_buffer( : : WindowHandle : )
Description
flush_buffer
flushes the contents of the window
WindowHandle
.
flush_buffer
is only necessary if the window parameter
'flush' has been set to 'false' with
set_window_param
. If 'flush' is 'false' all
display operations (such as disp_obj
or disp_text
) are
redirected to a buffer and have no effect on WindowHandle
(this applies for all window modes). flush_buffer
copies the
contents of this buffer to the window WindowHandle
.
This is very useful to avoid flickering by batching several display
operations (e.g., a clear_window
followed by a disp_obj
)
and displaying the final result with flush_buffer
.
This does not apply to drawing objects, which are always updated.
Attention
flush_buffer
depends on the library libcanvas, which might not be
available on embedded systems.
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
WindowHandle
(input_control) window →
(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_buffer
returns 2 (
H_MSG_TRUE)
.
Possible Predecessors
Possible Successors
See also
Module
Foundation