Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're guaranteed that it's an uncompressed 24bpp bitmap and its width is divisible by 4, it's relatively simple:</p> <ol> <li>Read a <code>BmpHeader</code> at the start of the file.</li> <li>Without seeking, read a <code>BmpImageInfo</code>.</li> <li>Seek to the <code>BmpHeader</code>'s <code>offset</code> bytes from <em>the beginning of the file</em>. Note that there is no palette (at least, not one we care about) in 24-bit bitmaps!</li> <li>Read BGR triplets (in that order, and there's no <code>reserved</code> unused member here). There will be (<code>BmpImageInfo</code>'s members) <code>width * abs(height)</code> triplets. As I recall, if <code>height</code> is positive (the standard case), the first line of color you read will be the <em>bottom</em> line of the image, going up from there. If <code>height</code> is negative, though, the first line of color in the file is the <em>top</em> of the image, going down from there.</li> </ol> <p>If you can't make those guarantees, then things get a good deal more complicated.</p> <p><strong>Disclaimer: I'm gratuitously tooting my own horn here.</strong> Years ago I wrote a tiny (one source file) utility to do exactly what you're talking about, in a portable (100% ANSI C) way: <del>glbmp</del> <a href="https://github.com/chazomaticus/libbmpread" rel="nofollow noreferrer">libbmpread</a>. Its source might shed some light on your problem--it handles uncompresed (no RLE) bitmaps of any bit depth, and should run fine on a GBA.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload