lpcware

Problems displaying bitmap in Memory Device

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by pcalton on Fri Aug 09 13:13:33 MST 2013
I am experimenting with Memory Devices and I am trying to get text to display on top of a bitmap using the following code:


GUI_Init();
GUI_EnableAlpha(1);
WM_SetCreateFlags(WM_CF_MEMDEV);
hIntro1 = GUI_MEMDEV_CreateFixed(0, 0, 480, 272, GUI_MEMDEV_HASTRANS, GUI_MEMDEV_APILIST_32, GUI_COLOR_CONV_8888);
GUI_MEMDEV_Select(hIntro1);
GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
GUI_DrawBitmap(&bmIntroImage, 0, 1);
GUI_SetFont(GUI_FONT_32B_ASCII);
GUI_SetColor(GUI_DARKRED);
GUI_DispStringHCenterAt("Welcome", 240, 120);
GUI_MEMDEV_CopyToLCD(hIntro1);


The image bmIntroImage was a png file that was converted to a c file using the BmpCvt tool.

If I pass GUI_MEMDEV_NOTRANS to GUI_MEMDEV_CreateFixed then my image is displayed correctly, but the text has a black background.
If I pass GUI_MEMDEV_HASTRANS to GUI_MEMDEV_CreateFixed then my image is tinted yellow and is stretched across the X axis interspersed with black vertical lines.

What am I doing wrong?

Outcomes