Changes between Version 14 and Version 15 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CBitmap


Ignore:
Timestamp:
04/14/25 07:28:07 (3 months ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TabularUnified Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CBitmap

    v14 v15  
    4040
    4141{{{#!c++
    42 int LoadBitmap(const string& strFilename, PALETTE_ITEM* transparent = NULL);
    43 int LoadBitmap(const char* pszFilename, PALETTE_ITEM* transparent = NULL);
     42int LoadBitmap(const string& strFilename, PALETTE_ITEM* transparent = NULL, bool invert = false);
     43int LoadBitmap(const char* pszFilename, PALETTE_ITEM* transparent = NULL, bool invert = false);
    4444}}}
    4545
     
    4848 * pszFilename - filename
    4949 * 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.
    5051
    5152==== Return Value ====
     
    6566It 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.
    6667
     68Setting 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
    6770==== Example ====
    6871
     
    8588CBitmap bitamp;
    8689if(bitmap.LoadBitmap("/mnt/nand/apps/myapp/myapp.bmp", &trans) != BITMAP_SUCCESS)
     90{
     91    DisplayText(0, 0, "Error loading bitmap");
     92}
     93}}}
     94
     95{{{#!c++
     96CBitmap bitamp;
     97bool invert = false;
     98if(dspMain.GetDarkMode() == true) {
     99    invert = true;
     100}
     101if(bitmap.LoadBitmap("/mnt/nand/apps/myapp/myapp.bmp", nullptr, invert) != BITMAP_SUCCESS)
    87102{
    88103    DisplayText(0, 0, "Error loading bitmap");