已经补充问题描述 ,求工程师和大侠们解释 关于load图片的问题!!!

5楼
工程师您好!
我按照graphic guide的方法将图片读进来,会出错,
运行sample code中的graphic里的 会弹出一个对话框。也是这个问题。
大意是“找不到pdb文件,该文件夹中有名字相同的文件,但不是正确的”
后来看到论坛上有人写的另一种fopen方法
VMINT hcanvas;
VMUINT8 *res, *canvas_buf;
struct frame_prop *img_prop;
hcanvas=LoadImageByName(".//1.jpg");
img_prop=vm_graphic_get_img_property(hcanvas,1);
canvas_buf = vm_graphic_get_canvas_buffer(hcanvas);
vm_graphic_set_clip(0,0,img_prop->width,img_prop->height);
vm_graphic_blt(layer_buf,0,0,canvas_buf,0,0,img_prop->width,img_prop->height,1);
static VMINT LoadImageByName(VMSTR name)
{
VMUINT8 *res;
VMFILE file;
VMUINT nSize;
VMUINT nFileSize;
struct frame_prop *infopic; //IMG 单帧结构体
VMINT img;
file=vm_file_open(vm_ucs2_string(name),MODE_READ,FALSE);
if(file>=0)
{
vm_file_getfilesize(file,&nFileSize);
res=(VMUINT8*)vm_malloc(nFileSize);
vm_file_read(file,res,nFileSize,&nSize);
vm_file_close(file);
img=vm_graphic_load_image(res,nFileSize);//返回画布的句柄
vm_free(res);
}
return img;
}
还是出现同样的问题。http://forum.eepw.com.cn/thread/189704/1
描述的是同样的问题。。。
求解!
我按照graphic guide的方法将图片读进来,会出错,
运行sample code中的graphic里的 会弹出一个对话框。也是这个问题。
大意是“找不到pdb文件,该文件夹中有名字相同的文件,但不是正确的”
后来看到论坛上有人写的另一种fopen方法
VMINT hcanvas;
VMUINT8 *res, *canvas_buf;
struct frame_prop *img_prop;
hcanvas=LoadImageByName(".//1.jpg");
img_prop=vm_graphic_get_img_property(hcanvas,1);
canvas_buf = vm_graphic_get_canvas_buffer(hcanvas);
vm_graphic_set_clip(0,0,img_prop->width,img_prop->height);
vm_graphic_blt(layer_buf,0,0,canvas_buf,0,0,img_prop->width,img_prop->height,1);
static VMINT LoadImageByName(VMSTR name)
{
VMUINT8 *res;
VMFILE file;
VMUINT nSize;
VMUINT nFileSize;
struct frame_prop *infopic; //IMG 单帧结构体
VMINT img;
file=vm_file_open(vm_ucs2_string(name),MODE_READ,FALSE);
if(file>=0)
{
vm_file_getfilesize(file,&nFileSize);
res=(VMUINT8*)vm_malloc(nFileSize);
vm_file_read(file,res,nFileSize,&nSize);
vm_file_close(file);
img=vm_graphic_load_image(res,nFileSize);//返回画布的句柄
vm_free(res);
}
return img;
}
还是出现同样的问题。http://forum.eepw.com.cn/thread/189704/1
描述的是同样的问题。。。
求解!

回复
打赏帖 | |
---|---|
【Zephyr】MCXN947 Zephyr 开发入门适配shell被打赏20分 | |
【我要开发板】6.联合MATLAB记录数据被打赏50分 | |
【瑞萨RA2E1开发板】:使用ADC功能实现位移传感器采集方案被打赏20分 | |
【nRF7002DK】基于sht30的温湿度计被打赏20分 | |
【nRF7002DK】日志打印被打赏20分 | |
【换取手持示波器】RGB屏幕移植ARM-2D库被打赏35分 | |
【分享开发笔记,赚取电动螺丝刀】分享一下如何解决瑞萨RA2E1使用printf编译报错问题被打赏27分 | |
rtthread硬件加密-5hash加密分析被打赏10分 | |
【换取手持示波器】Mongoose 零代码创建网页仪表盘被打赏33分 | |
【分享开发笔记,赚取电动螺丝刀】基于.Net6.0 WPF简单做一个MQTT收发小工具被打赏24分 |