How to draw a GIF with Scale to IMAGE Widget and keep transparency?

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

    • How to draw a GIF with Scale to IMAGE Widget and keep transparency?

      Hello
      Thank you for all.

      I want to draw a scaled GIF SUB(s) Images with IMAGE widget.
      I set a Callback of IMAGE, and use GUI_GIF_DrawSubScaled at WM_Paint.
      but the Transparency of My GIF Animated has loss.

      void cbAnimation(WM_MESSAGE* pMsg)
      {
      const tAnimation *rAnimation;
      switch (pMsg->MsgId)
      {
      case WM_PAINT:
      GUI_GIF_DrawSubScaled(Image, Size, 0, 0, Frame, 1, 2);
      break;
      default: WM_DefaultProc(pMsg);
      }
      }

      hwnd= IMAGE_CreateUser(0, 0, 100, 100, 0, WM_CF_SHOW , IMAGE_CF_MEMDEV, 0, sizeof(void *));
      IMAGE_SetGIF(hwnd, Image, Size);

      (the variables are use only for explaining.)

      Also i try with Window, the result was same

      whould you send me an example for how to draw a correct scaled GIF sub Image?


      At attachment picture(s), there are two type of GIF Animated.

      Best Regards.
      Images
      • Capture.PNG

        17.33 kB, 687×323, viewed 1,176 times
    • Hi,

      Attached is a short example.

      The reason on side is most likely related to the GIF. Try to open the GIF with GIMP (or any other image editor tool) and un-optimize the GIF. Most GIFs are saved optimzed which means they store only the difference to the previous image. Unfortunately, this results in a strange output when only a sub image gets drawn.

      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.