Display a picture/video from SD-Card

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Display a picture/video from SD-Card

      Hello,
      How can I get to display on screen a picture stored in the SD-card in a conventional format with EmWin?
      It's something I can't wrap my head around. I sense I've to used the functions ending in "Ex" like "GUI_MOVIE_CreateEx()" but I
      don't understand how I am supposed to write the GetData() function to retrieve the image/video file from the SD-card.
      Any help with sample code would be more than welcome

      Thanks !
    • Hi,

      You have to create a GUI_MOVIE_HANDLE with the function GUI_MOVIEW_CreateEx(). The first parameter of this function a function pointer to a 'GetData-function'. The second parameter is a pointer to a file handle and the third parameter a pointer to a callback function which can be used to get some information about the movie progress. The third parameter can also be NULL. Of course, the file handle has to be valid, so you have to open a file pointing to the *.emf file on the SD card.

      The GetData-function uses the pointer to the file handle to access the file and read the requested data. How this GetData-function should look like is described in the emWin user manual. Just search for 'APP_GetData', it is the second type of GetData-function (with the headline 'Example (PNG and streamed bitmap)').


      I have attached an example which shows how this can be done. The example uses preprocessor defines to switch between Windows API and our own file system, emFile.

      Regards,
      Sven
      Files
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.