Jump to content

Nico Hell

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for your answer, I guess I will try that. I tried to test if the file read was corrupted by looking directly into the memory, it did not seem to be corrupted, the pointer passed to gwinImageOpenMemory was correct, containing the very same data than the original PNG file. Could still be a driver issue or the interaction between the driver and uGFX, I need to look more in depth into that.
  2. Actually I might need some help with my current issue, I managed to open and display a PNG file using OpenMemory function. However, the image displayed is a bit weird: it looks like parts of it are mixed up or removed. I will attach the image I want to display and the actual result I get + the code just to show how it is done. Can someone possibly explain this weird behaviour ? Any help would be appreciated. static GHandle gh_image; /******************************************************************************/ eStatus IF_EINK_DISPLAY_displayImage(uint8_t * const kpu8_imgBuffer, uint16_t u16_iX, uint16_t u16_iY, uint16_t u16_iWidth, uint16_t u16_iHeight) { uint32_t u32_startTick = HAL_GetTick(); eStatus e_status = eOK; GWidgetInit widget; gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&BlackWidgetStyleLP, FALSE); gwinSetDefaultColor(GFX_WHITE); gdispClear(White); // Apply some default values for GWIN gwinWidgetClearInit(&widget); // Apply some default values for GWIN widget.g.show = TRUE; // create the first image widget widget.g.x = u16_iX; widget.g.y = u16_iY; widget.g.width = u16_iWidth; widget.g.height = u16_iHeight; gh_image = gwinImageCreate(NULL, &widget.g); gwinImageOpenMemory(gh_image, kpu8_imgBuffer); //Refresh screen to display image gdispFlush(); LOG(IF_EINK_DISPLAY, LVL_INFO, "PNG display in %d ms", HAL_GetTick() - u32_startTick); return e_status; }
  3. Nevermind, I got it right, I just needed to call gdispFlush() to refresh my screen and it works a bit (still some kind of decompression issue but that is something else)
  4. static GHandle gh_image; /******************************************************************************/ eStatus IF_EINK_DISPLAY_displayPNGFile(char * const pc_iFilePath, uint16_t u16_iX, uint16_t u16_iY, uint16_t u16_iWidth, uint16_t u16_iHeight) { uint32_t u32_startTick = HAL_GetTick(); eStatus e_status = eOK; GWidgetInit widget; gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); e_status = AP_FILE_MNGR_fillBufferFromFile(pc_iFilePath, g_au8_screenBuffer, CF_IT8951_SCREEN_WIDTH*CF_IT8951_SCREEN_HEIGHT); // Apply some default values for GWIN widget.g.show = TRUE; // create the first image widget widget.g.x = u16_iX; widget.g.y = u16_iY; widget.g.width = u16_iWidth; widget.g.height = u16_iHeight; gh_image = gwinImageCreate(NULL, &widget.g); gwinImageOpenMemory(gh_image, g_au8_screenBuffer); LOG(IF_EINK_DISPLAY, LVL_INFO, "PNG display in %d ms", HAL_GetTick() - u32_startTick); return e_status; } Here is the code implemented, I load my file in a buffer and try to use uGFX API to display it on screen, no effect currently
  5. Hello ! I started this topic because I might need some help to be able to display a PNG image on my screen. I tried to follow everything from the documentation but without success. I will try to explain what I would like to do if possible: the system I use already uses a filesystem (LittleFS), this filesystem contains a PNG file that I want to display on my screen but I do not know well what I have to do to make it works. Should I implement a USERFS ? I tried that but without success, perhaps I did not implement it properly. Otherwise, as my system already contains a file manager, what I would rather do is open my file and use it directly within a ImageBox widget, is there a way to do that ? Thanks for you help, if you need further details, just ask
×
×
  • Create New...