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

Developer

resources

Drawing to the display

In this example, the application uses IDisplay functions to draw text and an image to the display, then calls IDisplay_Update() to update the display.

AEERect rc;      
   AECHAR szBuf[30] = {0};     
   AECHAR *szText = L"Hello BREW";     
     
   IDISPLAY_DrawText(pMe->pIDisplay,    // Display instance     
          AEE_FONT_BOLD,        // Use BOLD font     
          szText,               // Text - Normally comes from resource     
          -1,                   // -1 = Use full string length     
           0,                   // Ignored - IDF_ALIGN_CENTER     
           0,                   // Ignored - IDF_ALIGN_MIDDLE     
           NULL,                // No clipping     
           IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);     
   IDISPLAY_ClearScreen (pMe->pIDisplay); //erases whole screen      
   SETAEERECT( &rc, 0, pMe->nHeight/2-2, pMe->nWidth, 2);     
   IDISPLAY_DrawRect(pMe->pIDisplay, &rc, 0, 1, IDF_RECT_FILL);     
     
   ISHELL_LoadResString(pMe->pIShell, C_APPLICATION_RES_FILE,IDS_STRING_1001,     
                  szBuf, sizeof(szBuf));     
   IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_NORMAL, szBuf, -1, pMe->nWidth/5,     
                  pMe->nHeight/8, 0, IDF_ALIGN_CENTER);     
     
   ISHELL_LoadResString(pMe->pIShell, C_APPLICATION_RES_FILE, IDS_STRING_1002,     
                  szBuf, sizeof(szBuf));     
   IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_NORMAL, szBuf, -1, pMe->nWidth/5,     
                  pMe->nHeight/5, 0, IDF_ALIGN_CENTER);     
        
   if (pMe->pIImage != NULL) {       
      IIMAGE_Release(pMe->pIImage);      
      pMe->pIImage = NULL;      
   }     
     
   pMe->pIImage = ISHELL_LoadResImage(pMe->pIShell,C_APPLICATION_RES_FILE,     
                  IDI_IMG_CURSOR);     
   if (pMe->pIImage != NULL) {     
      IIMAGE_Draw (pMe->pIImage, pMe->nCursorX, pMe->nCursorY);     
   }     
     
   IDISPLAY_Update (pMe->pIDisplay);