已经补充问题描述 ,求工程师和大侠们解释 关于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
描述的是同样的问题。。。
求解!

回复
打赏帖 | |
---|---|
【STM32F769】AI之与本地deepseek对接被打赏50分 | |
Buck电路工作在CCM模式下电感电流的计算公式是什么?被打赏5分 | |
buck电路工作原理被打赏5分 | |
基于MSPM0L1306的MODBUS-RTU协议通讯实验被打赏100分 | |
我想要一部加热台+多合一调试工具被打赏18分 | |
每周了解几个硬件知识+485硬件知识分享被打赏10分 | |
【换取手持数字示波器】树莓派PICO调试器官方固件本地化部署实践被打赏24分 | |
【换取手持数字示波器】分享一个KEIL无法识别CMSIS-DAP调试器的解决办法被打赏20分 | |
【换取手持数字示波器】分享一个自制的ArduinoNano扩展板底板被打赏23分 | |
【换取手持示波器】树莓派PICOW网页烟花被打赏18分 |