未验证 提交 d253f86e 编写于 作者: O openharmony_ci 提交者: Gitee

!9343 翻译完成 9212:ts-basic-components-xcomponent.md

Merge pull request !9343 from ester.zhou/TR-9212
# XComponent
The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data input.
> **NOTE**
>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
> **NOTE**
>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data input.
## Required Permissions
......@@ -13,11 +12,11 @@ The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data in
## Child Components
Not supported
Not supported
## APIs
XComponent\(value: {id: string, type: string, libraryname?: string, controller?: XComponentController}\)
XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController})
**Parameters**
......@@ -60,7 +59,7 @@ xcomponentController: XComponentController = new XComponentController()
### getXComponentSurfaceId
getXComponentSurfaceId(): string
getXComponentSurfaceId()
Obtains the ID of the surface held by the **\<XComponent>**. The ID can be used for @ohos interfaces, such as camera-related interfaces.
......@@ -72,9 +71,10 @@ Obtains the ID of the surface held by the **\<XComponent>**. The ID can be used
| ------ | ----------------------- |
| string | ID of the surface held by the **\<XComponent>**.|
### setXComponentSurfaceSize
setXComponentSurfaceSize(value: {surfaceWidth: number, surfaceHeight: number}): void
setXComponentSurfaceSize(value: {surfaceWidth: number, surfaceHeight: number})
Sets the width and height of the surface held by the **\<XComponent>**.
......@@ -87,9 +87,10 @@ Sets the width and height of the surface held by the **\<XComponent>**.
| surfaceWidth | number | Yes | Width of the surface held by the **\<XComponent>**.|
| surfaceHeight | number | Yes | Height of the surface held by the **\<XComponent>**.|
### getXComponentContext
getXComponentContext(): Object
getXComponentContext()
Obtains the context of an **\<XComponent>** object.
......@@ -99,6 +100,7 @@ Obtains the context of an **\<XComponent>** object.
| ------ | ---------------------------------------- |
| Object | Context of the **\<XComponent>** object. The APIs contained in the context are defined by developers.|
## Example
Provide a surface-type **\<XComponent>** to support capabilities such as camera preview.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册