在运用vm_load_resource函数载入资源时无法加载图像资源。
调试窗口出现以下描述,感觉是找不到该函数的意思,不知如何解决?
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6001.22319_x-ww_f0b4c2df\GdiPlus.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msimg32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'D:\Program Files\VRE IDE\lib\rc.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded 'C:\WINDOWS\system32\mfc42loc.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'D:\Program Files\360\360Safe\safemon\safemon.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shell32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcp60.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wininet.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\crypt32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msasn1.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\psapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msctfime.ime', no matching symbolic information found.
2010-09-26 16:38:45 [ERROR]- Failed Get app require of memory.
2010-09-26 16:38:45 [FATAL]- file handler = -1
2010-09-26 16:38:45 [ERROR]- Failed to load [E:graphic.gif] resouce
2010-09-26 16:38:45 [ERROR]- load resource failed!
该问题已经解决了:
我使用了一个函数,通过文件名读取图片,支持gif, jpg, bmp格式,返回一个画布的句柄
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;
}
使用示例:
VMINT hcanvas;
VMUINT8 *res, *canvas_buf;
struct frame_prop *img_prop;
hcanvas=LoadImageByName(".//test.bmp");
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[1],10,h,canvas_buf,0,0,img_prop->width,img_prop->height,1);
我使用了一个函数,通过文件名读取图片,支持gif, jpg, bmp格式,返回一个画布的句柄
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;
}
使用示例:
VMINT hcanvas;
VMUINT8 *res, *canvas_buf;
struct frame_prop *img_prop;
hcanvas=LoadImageByName(".//test.bmp");
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[1],10,h,canvas_buf,0,0,img_prop->width,img_prop->height,1);
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
与电子爱好者谈读图二被打赏50分 | |
【FRDM-MCXN947评测】Core1适配运行FreeRtos被打赏50分 | |
【FRDM-MCXN947评测】双核调试被打赏50分 | |
【CPKCORRA8D1B评测】---移植CoreMark被打赏50分 | |
【CPKCORRA8D1B评测】---打开硬件定时器被打赏50分 | |
【FRDM-MCXA156评测】4、CAN loopback模式测试被打赏50分 | |
【CPKcorRA8D1评测】--搭建初始环境被打赏50分 | |
【FRDM-MCXA156评测】3、使用FlexIO模拟UART被打赏50分 | |
【FRDM-MCXA156评测】2、rt-thread MCXA156 BSP制作被打赏50分 | |
【FRDM-MCXN947评测】核间通信MUTEX被打赏50分 |