Method for drawing a predefined bitmap with BREWTM

xiaoxiao2021-03-06  37

Predefined bitmap drawing methods with BREW ™ September 12, 2003 Author: Qualcomm mobile front line

Draw a predefined bitmap method
Document ID: 48

By using the ISHELL interface ishell_loadResimage For resources) or iShell_loadImage (for file), followed by IIMAGE_DRAW, it is easy to load and draw images from files or resources. This article demonstrates the basic steps required to load and display the bitmap using the ISHELL and IIMAGE interface.

From the resource displayed step:

  1. Create a bitmap
  2. Add it to the resource editor Compile in the resource editor. Bar And .h file
  3. Add .h file Add to your project Using ISHELL_LOADRESIMAGE
  4. Using IIMAGE_DRAW () Display Image Using iDisplay_update () Update Screen

    code example:

     #define my_res_file "myres.bar" // Load and display bitmap from the resource INT MyDisplayResimage () {type * pimage = null; aeedeviceInfo DM; // Get device information To view color depth iShell_getDeviceInfo (pshell, & dm); // If the color depth is greater than 4, load color bitmap if (DM.NCOLORDEPTH> 4) {// Load image from resources PIMAGE = ishell_loadResImage (pshell, my_res_file, IDB_MY_COLOR_BITMAP );} Else {// Load image from the resource PIMAGE = ISHELL_LOADRESIMAGE (Pshell, My_RES_FILE, IDB_MY_BW_BITMAP);} If (! Pimage) returnif; // Load failed // Draw images at coordinates (0,0) Draw images IIMAGE_DRAW PIIMAGE, 0, 0); // Update Screen iDisplay_update (PDISPLAY); // Release IIMAGE Object IIMAGE_RELEASE (PIMAGE); Return Success;}  

    From the file display image: < OL> Using ISHELL_LOADIMAGE Load Image From File Using IIMAGE_DRAW () Display Image Using iDisplay_UPDATE () Update screen

    code example:

     // Load and display image from the file INT MyDisplayfil EIMAGE () {iImage * pimage = null; AECHAR * PIMAGEFILE = NULL; AeedEviceInfo DM; AECHAR SZCOLORBMP [] = {'c', 'o', 'L', 'O', 'R', '.', ' B ',' M ',' P '}; AECHAR SZBWBMP [] = {' m ',' o ',' n ',' o ','. ',' b ',' m ',' p '} ; // Get setup information to view color depth iShell_getDeviceInfo (pshell, & dm); // If the color depth is greater than 4, load color bitmap if (DM.NCOLORDEPTH> 4) pimagefile = szcolorbmp;

转载请注明原文地址:https://www.9cbs.com/read-62094.html

New Post(0)