在使用此函数时遇到麻烦了:
无论原图片大小为何,只有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 跳转至页
回复
| 有奖活动 | |
|---|---|
| 硬核工程师专属补给计划——填盲盒 | |
| “我踩过的那些坑”主题活动——第002期 | |
| 【EEPW电子工程师创研计划】技术变现通道已开启~ | |
| 发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
| 【EEPW在线】E起听工程师的声音! | |
| 高校联络员开始招募啦!有惊喜!! | |
| 【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
| 送您一块开发板,2025年“我要开发板活动”又开始了! | |
我要赚赏金
