完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
各位大神好,现在我使用emwin中的控件image显示图片,由于图片太多,所以放在外部的flash芯片中。程序代码如下:
[C] 纯文本查看 复制代码 unsigned char _acBuffer[320*4*8];int _GetData(void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off) {static int FileAddress = 0;UINT NumBytesRead;FIL *PicFile;PicFile = (FIL *)p;/** Check buffer size*/if (NumBytesReq > sizeof(_acBuffer)) {NumBytesReq = sizeof(_acBuffer);}/** Set file pointer to the required position*/if(Off == 1) FileAddress = 0;else FileAddress = Off;result =f_lseek(PicFile, FileAddress);/** Read data into buffer*/result = f_read(PicFile, _acBuffer, NumBytesReq, &NumBytesRead);/** Set data pointer to the beginning of the buffer*/*ppData = (const U8 *)_acBuffer;/** Return number of available bytes*/return NumBytesRead;} [C] 纯文本查看 复制代码 void DisplayImageFromExFlash(IMAGE_Handle hObj,const TCHAR* path){ FRESULT res_flash; res_flash = f_open(&fnew1, path, FA_OPEN_EXISTING | FA_READ); IMAGE_SetBMPEx ( hObj, _GetData, &fnew1); f_close(&fnew1);} 发现程序执行到IMAGE_SetBMPEx ( hObj, _GetData, &fnew1);并不会调到int _GetData(void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off) 中,而是直接执行f_close(&fnew1);过后再执行_GetData(), 导致显示不了图片,请问这是什么原因呢?谢谢 |
|
相关推荐
1个回答
|
|
|
|
只有小组成员才能发言,加入小组>>
689 浏览 1 评论
2117 浏览 5 评论
2429 浏览 9 评论
移植了freeRTOS到STMf103之后显示没有定义的原因?
2194 浏览 6 评论
2163 浏览 7 评论
使用eim外接fpga可是端口一点反应都没有有没有大哥指点一下啊
317浏览 9评论
299浏览 7评论
请教大神怎样去解决iMX6Q在linux3.0.35内核上做AP失败的问题呢
435浏览 6评论
300浏览 5评论
348浏览 5评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-25 06:49 , Processed in 0.886625 second(s), Total 75, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号