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

!23387 【3.2release】fix docs

Merge pull request !23387 from shegangbin/fix_docs_0829
...@@ -52,6 +52,10 @@ libnative_window.so ...@@ -52,6 +52,10 @@ libnative_window.so
OH_NativeXComponent *nativeXComponent = nullptr; OH_NativeXComponent *nativeXComponent = nullptr;
// 通过napi_unwrap接口,解析出NativeXComponent的实例指针 // 通过napi_unwrap接口,解析出NativeXComponent的实例指针
napi_unwrap(env, exportInstance, reinterpret_cast<void**>(&nativeXComponent)); napi_unwrap(env, exportInstance, reinterpret_cast<void**>(&nativeXComponent));
// 获取XComponentId
char idStr[OH_XCOMPONENT_ID_LEN_MAX + 1] = {};
uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1;
OH_NativeXComponent_GetXComponentId(nativeXComponent, idStr, &idSize);
``` ```
3. 定义 OH_NativeXComponent_Callback。 3. 定义 OH_NativeXComponent_Callback。
```c++ ```c++
...@@ -103,10 +107,6 @@ libnative_window.so ...@@ -103,10 +107,6 @@ libnative_window.so
int32_t height = 0x100; int32_t height = 0x100;
// 这里的nativeWindow是从上一步骤中的回调函数中获得的 // 这里的nativeWindow是从上一步骤中的回调函数中获得的
int32_t ret = OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, width, height); int32_t ret = OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, width, height);
// 设置 OHNativeWindowBuffer 的步长
code = SET_STRIDE;
int32_t stride = 0x8;
ret = OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, stride);
``` ```
3. **从图形队列申请OHNativeWindowBuffer** 3. **从图形队列申请OHNativeWindowBuffer**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册