Changes between Version 14 and Version 15 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CBitmap
- Timestamp:
- 04/14/25 07:28:07 (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CBitmap
v14 v15 40 40 41 41 {{{#!c++ 42 int LoadBitmap(const string& strFilename, PALETTE_ITEM* transparent = NULL );43 int LoadBitmap(const char* pszFilename, PALETTE_ITEM* transparent = NULL );42 int LoadBitmap(const string& strFilename, PALETTE_ITEM* transparent = NULL, bool invert = false); 43 int LoadBitmap(const char* pszFilename, PALETTE_ITEM* transparent = NULL, bool invert = false); 44 44 }}} 45 45 … … 48 48 * pszFilename - filename 49 49 * transparent - (optional parameter) if specified defines a particular color to treat as transparent instead of displaying the color 50 * invert - (optional parameter) if specified and set to true the bitmap colors will be inverted. 50 51 51 52 ==== Return Value ==== … … 65 66 It is recommended that bitmaps should have a width that is evenly dividable by 4 such as 24, 32, 64, 68, etc... Otherwise the width will be padded to an even value. 66 67 68 Setting the invert parameter true can be useful for dark mode. This allows a single bitmap with a white background to be used for regular or dark mode. When in invert is true the background will become black. 69 67 70 ==== Example ==== 68 71 … … 85 88 CBitmap bitamp; 86 89 if(bitmap.LoadBitmap("/mnt/nand/apps/myapp/myapp.bmp", &trans) != BITMAP_SUCCESS) 90 { 91 DisplayText(0, 0, "Error loading bitmap"); 92 } 93 }}} 94 95 {{{#!c++ 96 CBitmap bitamp; 97 bool invert = false; 98 if(dspMain.GetDarkMode() == true) { 99 invert = true; 100 } 101 if(bitmap.LoadBitmap("/mnt/nand/apps/myapp/myapp.bmp", nullptr, invert) != BITMAP_SUCCESS) 87 102 { 88 103 DisplayText(0, 0, "Error loading bitmap");