24 bit pictures still use of 32bit screen memory. They just save a little drive space by keeping alpha at 255 for the whole image.
If you’re making a BMP picture viewer, why wouldn’t you use _LOADIMAGE with it?
If all you want is 24 bits, then you’d need to read your 32bit screen and just take the RGB bytes and store them. Basically with something like the following with what you had above.
DIM O AS _OFFSET, S AS STRING * 3
DO
_MEMGET M, M.OFFSET + O +1 S ‘ARGB, and you only want 3 bytes
temp$ = temp$ + S
O = O + 4
LOOP UNTIL O >= M.SIZE
temp$ now olny holds your total RGB values. Compress it and save it to disk...
temp$ = _DEFLATE$(temp$)
PUT #1, , temp$
You really should watch the mem tutorials. It covers all this stuff and more.