在运用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网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
vscode+cmake搭建雅特力AT32L021开发环境被打赏30分 | |
【换取逻辑分析仪】自制底板并驱动ArduinoNanoRP2040ConnectLCD扩展板被打赏47分 | |
【分享评测,赢取加热台】RISC-V GCC 内嵌汇编使用被打赏38分 | |
【换取逻辑分析仪】-基于ADI单片机MAX78000的简易MP3音乐播放器被打赏48分 | |
我想要一部加热台+树莓派PICO驱动AHT10被打赏38分 | |
【换取逻辑分析仪】-硬件SPI驱动OLED屏幕被打赏36分 | |
换逻辑分析仪+上下拉与多路选择器被打赏29分 | |
Let'sdo第3期任务合集被打赏50分 | |
换逻辑分析仪+Verilog三态门被打赏27分 | |
换逻辑分析仪+Verilog多输出门被打赏24分 |