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

!19316 drawing示例中的copy代替memcpy_s

Merge pull request !19316 from JIAHE LIU/memcpy
......@@ -128,10 +128,7 @@ The following steps describe how to use the canvas and brush of the Native Drawi
```c++
// Obtain the pixel address after drawing. The memory to which the address points contains the pixel data of the drawing on the canvas.
void* bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap);
auto ret = memcpy_s(addr, addrSize, bitmapAddr, addrSize);
if (ret != EOK) {
LOGI("memcpy_s failed");
}
std::copy(addr, addr + addrSize, static_cast<uint8_t*>(bitmapAddr));
// Destroy the canvas object.
OH_Drawing_CanvasDestroy(cCanvas);
// Destroy the bitmap object.
......
......@@ -128,10 +128,7 @@ Native Drawing模块提供了一系列的接口用于基本图形和字体的绘
```c++
// 画完后获取像素地址,地址指向的内存包含画布画的像素数据
void* bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap);
auto ret = memcpy_s(addr, addrSize, bitmapAddr, addrSize);
if (ret != EOK) {
LOGI("memcpy_s failed");
}
std::copy(addr, addr + addrSize, static_cast<uint8_t*>(bitmapAddr));
// 销毁canvas对象
OH_Drawing_CanvasDestroy(cCanvas);
// 销毁bitmap对象
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册