[issue : image Rotation does not work.]

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

    • [issue : image Rotation does not work.]

      Hello,
      I want to rotate bmp using mem-device function as below.
      I refered to "GUI_MEMDEV_Rotate.c" as example.
      final output was just yellow rectagle, not bmp image.
      Can anyone advice to me what is wrong on below codes?

      FYI, bmp is 16bit(565) bmp data.

      //-----------------------------------------------------------------------------------------------//
      GUI_MEMDEV_Handle hMemSrc,hMemDst;

      hMemSrc = GUI_MEMDEV_CreateFixed(0, 0, 30,30,GUI_MEMDEV_NOTRANS,GUI_MEMDEV_APILIST_16,GUI_COLOR_CONV_565 );
      GUI_MEMDEV_Select(hMemSrc);//Select the memory device.

      GUI_DrawBmp(....);

      GUI_MEMDEV_Select(0);
      // GUI_MEMDEV_WriteAt(hMemSrc, 226+6, 54); // bmp is printed well here.

      hMemDst = GUI_MEMDEV_CreateFixed(0, 0, 30,30,GUI_MEMDEV_NOTRANS,GUI_MEMDEV_APILIST_16, GUI_COLOR_CONV_565);
      GUI_MEMDEV_Select(hMemDst);
      GUI_SetBkColor(GUI_YELLOW);//bg-color for test.
      GUI_Clear();

      GUI_MEMDEV_Select(0);

      GUI_MEMDEV_RotateHQHR(hMemSrc, hMemDst, 0, 0, 45 * 1000, 1 * 1000);
      GUI_MEMDEV_WriteAt(hMemDst, 226+6, 54);// just yellow rectangle is printed.
      GUI_MEMDEV_Delete(hMemSrc);
      GUI_MEMDEV_Delete(hMemDst);
      //-----------------------------------------------------------------------------------------------//

      Best Regards,
      Tommy Lim
    • Hi Tommy,

      All the GUI_MEMDEV_Rotate...() routines require 32bpp source and destination devices, instead of 16bpp. GUI_MEMDEV_CreateFixed32() makes it easy to create a 32bpp device.

      I would recommend using GUI_MEMDEV_RotateHQ() to rotate the memory device.

      Best regards,
      Florian
      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.