Changes between Version 2 and Version 3 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/CBitmap


Ignore:
Timestamp:
04/06/11 10:01:04 (14 years ago)
Author:
Don Wilson
Comment:

--

Legend:

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

    v2 v3  
    8181Function does not accept any parameters
    8282
    83 ==== Retrun Value ====
     83==== Return Value ====
    8484 
    8585Function does not return any result.
     
    9898}}}
    9999
     100=== Draw ===
     101Draws the bitmap on the LCD display
     102{{{
     103void Draw(int x, int y);
     104}}}
     105
     106==== Parameters ====
     107
     108x - The X coordinate for the left side of the bitmap to be displayed
     109y - The Y coordinate for the top of the bitmap to be displayed
     110
     111==== Return Value ====
     112 
     113Function does not return any result.
     114
     115==== Remarks ====
     116
     117
     118==== Example ====
     119
     120{{{
     121CBitmap bitmap("/mnt/nand/apps/myapp/myapp.bmp");
     122bitmap.Draw(0, 0);
     123}}}
     124
     125
     126=== GetWidth ===
     127Get the width of the bitmap in pixels
     128{{{
     129int GetWidth(void);
     130}}}
     131
     132==== Parameters ====
     133
     134Function does not accept any parameters.
     135
     136==== Return Value ====
     137 
     138Function returns the width of the bitmap in pixels.
     139
     140==== Remarks ====
     141
     142
     143==== Example ====
     144
     145{{{
     146CBitmap bitmap("/mnt/nand/apps/myapp/myapp.bmp");
     147int x = bitmap.GetWidth();
     148}}}
     149
     150
     151=== GetHeight ===
     152Get the height of the bitmap in pixels
     153{{{
     154int GetHeight(void);
     155}}}
     156
     157==== Parameters ====
     158
     159Function does not accept any parameters.
     160
     161==== Return Value ====
     162 
     163Function returns the height of the bitmap in pixels.
     164
     165==== Remarks ====
     166
     167
     168==== Example ====
     169
     170{{{
     171CBitmap bitmap("/mnt/nand/apps/myapp/myapp.bmp");
     172int y = bitmap.GetHeight();
     173}}}
     174
     175
     176=== GetColorCnt ===
     177Get the number of colors the bitmap uses
     178{{{
     179int GetColorCnt(void);
     180}}}
     181
     182==== Parameters ====
     183
     184Function does not accept any parameters.
     185
     186==== Return Value ====
     187 
     188Function returns the number of colors used by the bitmap.
     189
     190==== Remarks ====
     191
     192
     193==== Example ====
     194
     195{{{
     196CBitmap bitmap("/mnt/nand/apps/myapp/myapp.bmp");
     197int n = bitmap.GetColorCnt();
     198}}}
     199
     200
     201=== GetColorsAdded ===
     202Get the numbers of colors added to the 825 global palette when the bitmap was loaded
     203{{{
     204int GetColorsAdded(void);
     205}}}
     206
     207==== Parameters ====
     208
     209Function does not accept any parameters.
     210
     211==== Return Value ====
     212 
     213Function returns the number of colors added to the 825 global palette when the bitmap was loaded.
     214
     215==== Remarks ====
     216
     217
     218==== Example ====
     219
     220{{{
     221CBitmap bitmap("/mnt/nand/apps/myapp/myapp.bmp");
     222int n = bitmap.GetColorsAdded();
     223}}}
     224
     225
     226=== GetError ===
     227Get the error code
     228{{{
     229int GetError(void);
     230}}}
     231
     232==== Parameters ====
     233
     234Function does not accept any parameters.
     235
     236==== Return Value ====
     237 
     238Function returns the current error code.
     239
     240==== Remarks ====
     241
     242
     243==== Example ====
     244
     245{{{
     246CBitmap bitmap("/mnt/nand/apps/myapp/myapp.bmp");
     247int err = bitmap.GetError();
     248if(err != 0)
     249{
     250   DisplayText(0, 0, "Error loading bitmap");
     251}
     252}}}
     253
     254
     255=== ReclaimColors ===
     256Reclaim custom colors added by loading bitmaps
     257{{{
     258static void ReclaimColors(void);
     259}}}
     260
     261==== Parameters ====
     262
     263Function does not accept any parameters.
     264
     265==== Return Value ====
     266 
     267Function does not return any value.
     268
     269==== Remarks ====
     270
     271In 8 bits per pixel mode all bitmaps and text or other graphics on the display at any given time must share a palette of 256 colors. ReclaimColors releases the colors that were added by displaying bitmaps.
     272
     273==== Example ====
     274
     275{{{
     276CBitmap img1("/mnt/nand/apps/myapp/img1.bmp");
     277CBitmap img2("/mnt/nand/apps/myapp/img2.bmp");
     278img1.Draw(0, 0);
     279img2.Draw(320, 0);
     280
     281SleepSeconds(5);
     282ClearLCD();
     283img1.DeleteBitmap();
     284img2.DeleteBitmap();
     285
     286CBitmap::ReclaimColors();
     287
     288CBitmap img3("/mnt/nand/apps/myapp/img3.bmp");
     289CBitmap img4("/mnt/nand/apps/myapp/img4.bmp");
     290img3.Draw(0, 0);
     291img4.Draw(320, 0);
     292}}}