Window

    Since:

    1.0

    Version:

    1.0

    Summary

    Files

    Data Structures

    Data Structure Name

    Description

    Sets the attributes for this window.

    OHOS::Window

    Provides a drawing canvas for the , which represents the root node of a view tree.

    Enumerations

    Enumeration Name

    Description

    OHOS::WindowPixelFormat { = 101, OHOS::WINDOW_PIXEL_FORMAT_ARGB1555, , OHOS::WINDOW_PIXEL_FORMAT_ARGB8888 }

    Enumerates the pixel formats of this window.

    Functions

    Details

    Enumeration Type Documentation

    WindowPixelFormat

    Description:

    Enumerates the pixel formats of this window.

    Enumerator

    Description

    WINDOW_PIXEL_FORMAT_RGB565 

    RGB565 format

    WINDOW_PIXEL_FORMAT_ARGB1555 

    ARGB1555 format

    WINDOW_PIXEL_FORMAT_RGB888 

    RGB888 format

    WINDOW_PIXEL_FORMAT_ARGB8888 

    ARGB8888 format

    BindRootView()

    Description:

    Binds the RootView to this window.

    Parameters:

    Name

    Description

    rootView Indicates the RootView to bind.

    CreateWindow()

    1. static [Window]($api-api-SmartVision-Devices-OHOS-Window.md)* OHOS::Window::CreateWindow (const [WindowConfig]($api-api-SmartVision-Devices-OHOS-WindowConfig.md) & config)

    Description:

    Creates a Window instance.

    Parameters:

    Returns:

    Returns the Window instance if the operation is successful; returns nullptr otherwise.

    DestoryWindow()

    1. static void OHOS::Window::DestoryWindow ([Window]($api-api-SmartVision-Devices-OHOS-Window.md) * window)

    Description:

    Destroys a specified window.

    Parameters:

    Name

    Description

    window Indicates the Window instance to destroy.

    GetRect()

    1. virtual [Rect]($api-api-SmartVision-Devices-OHOS-Rect.md) OHOS::Window::GetRect ()

    Description:

    Obtains the rectangle information (position, width, and height) of this window.

    Returns:

    Returns the rectangle information of this window.

    GetRootView()

    1. virtual [RootView]($api-api-SmartVision-Devices-OHOS-RootView.md)* OHOS::Window::GetRootView ()

    Description:

    Obtains the bound to this window.

    Returns:

    Returns the RootView if available; returns nullptr otherwise.

    GetWindowId()

    Description:

    Obtains the unique ID of this window.

    The window ID is within [0, 31]. An ID will be reused after the current window is destroyed. A maximum of 32 windows can be displayed at the same time.

    Returns:

    Returns the unique ID of this window if the operation is successful; returns -1 otherwise.

    Hide()

    Description:

    Hides this window.

    LowerToBottom()

    1. virtual void OHOS::Window::LowerToBottom ()

    Description:

    Lowers this window to the bottom.

    1. virtual void OHOS::Window::MoveTo (int16_t x, int16_t y )

    Description:

    Moves this window to a specified position.

    Parameters:

    Name

    Description

    x Indicates the x-coordinate of the target position.
    y Indicates the y-coordinate of the target position.

    RaiseToTop()

    1. virtual void OHOS::Window::RaiseToTop ()

    Description:

    Raises this window to the top.

    Resize()

    1. virtual void OHOS::Window::Resize (int16_t width, int16_t height )

    Description:

    Resizes this window.

    Parameters:

    Show()

    Description:

    Shows this window.

    UnbindRootView()

    Description:

    Unbinds the RootView from this window.

    Variable Documentation

    opacity

    1. uint8_t OHOS::WindowConfig::opacity

    Description:

    Opacity, within [0, 255]

    option

    1. uint32_t OHOS::WindowConfig::option

    Description:

    Other options

    pixelFormat

      Description:

      Pixel format

      1. [Rect]($api-api-SmartVision-Devices-OHOS-Rect.md) OHOS::WindowConfig::rect

      Description: