Good afternoon,
I'm trying to use the GUI_BMP_DrawEx() function in conjunction with FatFs. The modified GetData is the following:
and I call GUI_BMP_DrawEx(APP_GetData, str, 0, 0); where str is something like "Media/img1.BMP"
No image is loaded but I can correctly plot the image using other functions external to STemWin
Any suggestion?
Regards,
Fabio
I'm trying to use the GUI_BMP_DrawEx() function in conjunction with FatFs. The modified GetData is the following:
C Source Code
- int APP_GetData(void * p, const U8 * * ppData, unsigned NumBytesReq, U32 Off){FIL phFile; UINT NumBytesRead; U8 _acBuffer[512];f_open(&phFile, (TCHAR const*)p, FA_READ);// Check buffer sizeif (NumBytesReq > sizeof(_acBuffer)) { NumBytesReq = sizeof(_acBuffer); } // Set file pointer to the offset locationf_lseek(&phFile, Off); // Read data into bufferf_read(&phFile, _acBuffer, NumBytesReq, (UINT *)&NumBytesRead); // Set data pointer to the beginning of the buffer*ppData = _acBuffer;// Close filef_close(&phFile);
- // Return number of available bytesreturn NumBytesRead;}
and I call GUI_BMP_DrawEx(APP_GetData, str, 0, 0); where str is something like "Media/img1.BMP"
No image is loaded but I can correctly plot the image using other functions external to STemWin
Any suggestion?
Regards,
Fabio