Author Topic: Little tool to mark QB64 compiled EXE's with it size, for appending data.  (Read 4555 times)

0 Members and 1 Guest are viewing this topic.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Little tool to mark QB64 compiled EXE's with it size, for appending data.
« Reply #15 on: February 02, 2021, 08:19:50 pm »
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.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Little tool to mark QB64 compiled EXE's with it size, for appending data.
« Reply #16 on: February 02, 2021, 10:21:46 pm »
So there are at least 2 type of BMP files.  One type has 4 bytes per pixel and the other one has 3 bytes per pixel. Will _LOADIMAGE sort that out?

Maybe I'm mistaken though. The old BMP header specifies a max of 24 bits per pixel.  I'm not sure if the BMP header was updated to handle 32 bit per pixel?

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Little tool to mark QB64 compiled EXE's with it size, for appending data.
« Reply #17 on: February 02, 2021, 10:28:17 pm »
All you ever wanted to know about BMP specifications: http://www.dragonwins.com/domains/getteched/bmp/bmpfileformat.htm
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Aurel

  • Forum Regular
  • Posts: 167
    • View Profile
Re: Little tool to mark QB64 compiled EXE's with it size, for appending data.
« Reply #18 on: February 03, 2021, 03:56:03 pm »
Quote
When I append data to the end of an EXE, I always just count backwards from the length of the data.

Yes i do the same thing it is easy way.
//////////////////////////////////////////////////////////////////
https://aurelsoft.ucoz.com
https://www.facebook.com/groups/470369984111370
//////////////////////////////////////////////////////////////////