Transparent image is not displayed correctly with _SetBitmap function

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

    • Transparent image is not displayed correctly with _SetBitmap function

      I am using MCUXPresso and Emwin version 6.1, which comes with SDK I am using. I have a png image, which is partly transparent (attached) and I create bitmap file with BitMapCvt.
      I have used GUIBuilder to create a window. Inside code created by GUIBuilder I define the bitmap as:
      hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_1);
      IMAGE_SetBitmap(hItem, &bmok);

      I use the emwin with multibuffering:
      GUI_Init();
      GUI_Clear();
      WM_EnableMemdev(WM_HBKWIN);
      hWin = CreateSplashScreenWindow(); //This creates the image etc.
      GUI_MULTIBUF_Begin();
      GUI_Exec();
      GUI_MULTIBUF_End();


      The bitmap does not get drawn correctly (attached, sorry for the bad quality), but is partly distorted. It also seems that image is not drawn similarly every time it is drawn. This works fine, if I don't have transparency in the original file, but I would like to use transparency. Any ideas on how to correct this?
      Images
      • ok.png

        6.3 kB, 83×83, viewed 167 times
      • IMG_20210512.jpg

        269.54 kB, 1,119×1,017, viewed 310 times