Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Setting the color

To set the color, an application calls IDisplay_SetColor() specifying the color and the item for which the color is to be changed. The color items are defined in the AEEClrItem enum in AEEIDisplay.h.

In the following example, the application sets the color for the text, draws a rectangle, draws text in the rectangle, and set the color back to the original value.

// Set the color of the text to white,
   // and store the old RGB value:

   oldClr = IDisplay_SetColor(pMe->pIDisplay, CLR_USER_TEXT,
                  MAKE_RGB(255,255,255));
    
   IDISPLAY_DrawRect(pMe->pIDisplay, &rc, rectClr, rectClr,
                  IDF_RECT_FILL); //Draw the rectangle
	
   //Load the resource strings, and draw them on top of the rectangle
   ISHELL_LoadResString(pMe->pIShell, C_ROTATIONAPP_RES_FILE,IDS_STRING_1001,
                  szBuf, sizeof(szBuf));
   IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_NORMAL, szBuf, -1,
                  pMe->nWidth/5, pMe->nHeight/2 - 19,
                  0, IDF_ALIGN_CENTER | IDF_TEXT_TRANSPARENT );
   ISHELL_LoadResString(pMe->pIShell, C_ROTATIONAPP_RES_FILE,
                  IDS_STRING_1002, szBuf, sizeof(szBuf));
   IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_NORMAL, szBuf, -1,
                  pMe->nWidth/5, pMe->nHeight/2 + 5,
                  0, IDF_ALIGN_CENTER | IDF_TEXT_TRANSPARENT );

   //Set the text color back to the original value as good practice
   IDisplay_SetColor(pMe->pIDisplay, CLR_USER_TEXT, oldClr);