Skip to main content

OH_ConsumerSurface_CreateWithSingleBufferMode

Function OH_ConsumerSurface_CreateWithSingleBufferMode 

Source
pub unsafe extern "C" fn OH_ConsumerSurface_CreateWithSingleBufferMode(
    singleBufferMode: bool,
) -> *mut OH_NativeImage
Available on crate features native_image and api-22 only.
Expand description

Create a OH_NativeImage as consumerSurface, and choose whether to set single buffer mode.

This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.

This interface needs to be used in conjunction with OH_NativeImage_Destroy, otherwise memory leaks will occur.

Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeImage

§Arguments

  • singleBufferMode - Whether to set single buffer mode.

§Returns

  • Returns the pointer to the OH_NativeImage instance created if the operation is successful,

returns NULL otherwise.

Available since API-level: 22

Version: 1.0