在使用此函数时遇到麻烦了:
无论原图片大小为何,只有vm_graphic_load_image_resized()的第三个参数width设置为200时才能够正常缩放。
麻烦帮忙分析一下这个问题,谢谢。
共2条
1/1 1 跳转至页
关于vm_graphic_load_image_resized()函数的疑问
2楼
void Graph_DrawImageEx(VMINT layer_hdl ,VMCHAR*name,
VMINT x,VMINT y,VMINT width,VMINT height,VMINT trans)
{
VMUINT8 *cvs_buf,*layer_buf;
VMINT cvs_hdl;
struct frame_prop * img_prop = NULL;
if ((res = vm_load_resource(name, &size)) == NULL) {
vm_log_error("load resource failed!");
return ;
}
cvs_hdl =vm_graphic_load_image_resized(res,size,width,height);
/* 释放图片资源 */
vm_free(res);
/* 获取画布属性*/
img_prop = vm_graphic_get_img_property(cvs_hdl, 1);
/* 获取画布地址 */
cvs_buf= vm_graphic_get_canvas_buffer(cvs_hdl);
/* 获取层地址 */
layer_buf=vm_graphic_get_layer_buffer(layer_hdl);
/*画图:从画布到层*/
vm_graphic_blt_ex(layer_buf, x, y,cvs_buf, 0, 0, img_prop->width, img_prop->height, 1,trans);
vm_graphic_release_canvas(cvs_hdl);
}
共2条
1/1 1 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 【S32K3学习整理】使用 LPUART 的loopback 模式实现核间通讯被打赏¥28元 | |
| arduinounoq原生zephyr环境搭建被打赏¥31元 | |
| 树莓派3+Klipper,MPU6050共振补偿被打赏¥41元 | |
| GroveCreatorKit套件+摇杆测评被打赏¥18元 | |
| 设备功耗web监控界面(ESP32C5)被打赏¥28元 | |
| OrangePiZero2W系统被打赏¥33元 | |
| Linux环境下以模拟方式快速实现出入管理功能测试被打赏¥24元 | |
| 树莓派3+Klipper,老3D打印机满血升级被打赏¥33元 | |
| OK1126B-S开发板下串口屏及其应用被打赏¥21元 | |
| 低功耗超声波液位测距仪(ESP32S3)被打赏¥27元 | |
我要赚赏金
