AnsweredAssumed Answered

STemWin - GUI_JPEG_DrawEx

Question asked by ra hummel on Jan 24, 2017
Latest reply on Mar 23, 2017 by Roldan.Sergio

Hi.

I'm using STM32CubeF4 1.14.0 with STemWin 5.32.

I need to draw JPEGs from file using the DrawEx functions where the user has to provide a getData function which reads chunks of data from a file.

However the ...DrawEx functions do not provide any possibilty to cancel an ongoing drawing. As decoding of JPEG files need a lot of time it is necessary to have a possibility to cancel an ongoing drawing. At the moment you always have to wait until the image is fully loaded which may take a long time depending on the size of the image.

 

The Segger manual states that the drawing function will return immediately if the getData function doesn't return the requested number of bytes whereas the STemWin manual says that the function always has to return at least 1 Byte.

 

I tried to return 0 in the getData function but this will not cancel an ongoing loading of data from the image file. Instead the function will never return even when it gets no data at all.

 

In my opinion this is a perfect bug and should be fixed as soon as possible. Without the possibilty to cancel loading the data the library can not be used e.g. for applications like picture frames because one has to react fast on any user input instead to wait for seconds until loading and decompression has finished.

 

Is there any other possibilty to SAFELY cancel these drawing functions?. This is related to :

  • GUI_BMP_DrawEx, GUI_BMP_DrawScaledEx
  • GUI_JPG_DrawEx, GUI_JPEG_DrawScaledEx
  • GUI_PNG_DrawEx

Outcomes