April 13, 2025 at 1:18 PM #1 Is there an example how to create in-memory bitmap of an image stored in external .dta file?We have plenty of RAM and want to store all bitmaps on SD card and then, on power-up, load them in to RAMfor faster access.- Dejan
April 14, 2025 at 3:36 PM #2 Hello,just had such a code based on GUI_MBITMAP_Create() sample under WIN32. For using in WIN32 simulation add opengl32.lib in the linker input. C: Main.c #include "DIALOG.h" #include "windows.h" #define FILE_PATH "C:\\Image.dta" HANDLE hFile; GUI_MBITMAP * pMBitmap; IMAGE_Handle hImage; int _GetData(void * p, const U8 ** ppData, unsigned NumBytes, U32 Off) { HANDLE * phFile; DWORD NumBytesRead; U8 * pData; pData = (U8 *)*ppData; phFile = (HANDLE *)p; SetFilePointer(*phFile, Off, 0, FILE_BEGIN); ReadFile(*phFile, pData, NumBytes, &NumBytesRead, NULL); return NumBytesRead; } void MainTask(void) { GUI_Init(); WM_MULTIBUF_Enable(1); hFile = CreateFile(FILE_PATH, GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); pMBitmap = GUI_MBITMAP_CreateEx(GUI_MBITMAP_DTA_EX, _GetData, &hFile); hImage = IMAGE_CreateEx(10, 10, GUI_MBITMAP_2BITMAP(pMBitmap)->XSize, GUI_MBITMAP_2BITMAP(pMBitmap)->YSize, WM_HBKWIN, WM_CF_SHOW, 0, GUI_ID_IMAGE0); IMAGE_SetBitmap(hImage, GUI_MBITMAP_2BITMAP(pMBitmap)); while (1) { GUI_Delay(50); } } Display More