Hello,
I am trying to implement a button with transparent background, using GrLib along and implementing a CircularButton on a Kentec320x240x16_SSD2119 LCD screen.
So I am trying to use this image on my tiva:
My process:
1. Make transparent hex.png in gimp
2. Use "pngtopnm.exe hex.png > hex.pnm" from Netpbm
3. Use "pnmtoc -hex.pnm > hex.c" from C:\ti\TivaWare_C_Series-2.1.1.71\tools\pnmtoc
4. I get the correct struct for pui8Image:
uint8_t g_hexRimg[] = { IMAGE_FMT_8BPP_COMP, 20, 0, 20, 0, 128, 0x00, 0x00, 0x2a, ......etc etc
And then implement this with:
CircularButtonInit(&g_hexBtn_[ii],&g_sKentec320x240x16_SSD2119,(xpos[ii]),(ypos[ii]),radius); PushButtonTextOff(&g_hexBtn_[ii]); PushButtonAutoRepeatOff(&g_hexBtn_[ii]); PushButtonImageOn(&g_hexBtn_[ii]); PushButtonImageSet(&g_hexBtn_[ii],g_hexGimg); PushButtonFillOff(&g_hexBtn_[ii]); PushButtonOutlineOff(&g_hexBtn_[ii]); PushButtonAutoRepeatRateSet(&g_hexBtn_[ii], 100000); PushButtonAutoRepeatDelaySet(&g_hexBtn_[ii],100000); PushButtonCallbackSet(&g_hexBtn_[ii], &OnButtonPress_HexBtn); WidgetAdd((tWidget *)&g_GameScreen, (tWidget *)&g_hexBtn_[ii]); WidgetPaint(&g_hexBtn_[ii]);
And, the result image is this, note i did not show the loop used to create 121 shapes:
As you can the button images overlap and therefore do not make a transparent background..