OH_NativeWindow_NativeWindowHandleOpt

Function OH_NativeWindow_NativeWindowHandleOpt 

Source
pub unsafe extern "C" fn OH_NativeWindow_NativeWindowHandleOpt(
    window: *mut NativeWindow,
    code: i32,
    ...
) -> i32
Available on crate feature native_window only.
Expand description

Sets or obtains the attributes of a native window, including the width, height, and content format.

This interface is a non-thread-safe type interface.

API Note

Performance Note

By default, the window buffer in the current operating system is accessed via the CPU. If an application does not need to access the window buffer data using the CPU, it can proactively disable CPU access to enhance energy efficiency and reduce power consumption.

For details about how to optimize power consumption for data read/write operations in data buffers, see [How do I proactively disable CPU access to window buffers to reduce power consumption?][`https://developer.huawei.com/consumer/en/doc/harmonyos-faqs/faqs-arkgraphics-2d-14`].

Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeWindow

§Arguments

  • window - Indicates the pointer to a OHNativeWindow instance.

  • code - Indicates the operation code, pointer to NativeWindowOperation.

  • ... - variable parameter, must correspond to code one-to-one.

§Returns

  • Returns an error code, 0 is success, otherwise, failed.

Available since API-level: 8

Version: 1.0