.bmp

Discussions related to graphics (2D and 3D), animation and games programming
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

.bmp

Post by Ric »

Does anyone know how to *LOAD and then *SAVE a .bmp file?
I have tried this

Code: Select all

      DIM picture2D 100000

      file$ = "C:\Users\My Account\Desktop\Adding Weapons\Samples\colourTest.bmp"
      OSCLI "LOAD """ + file$ + " """ + STR$~picture2D

      pointer% = picture2D!10
      bmpW%    = picture2D!18
      bmpH%    = picture2D!22

      OSCLI "SAVE """+file$+""" "+STR$~picture2D+" +"+STR$~(pointer%+(bmpW%*bmpH%))
unfortunatey the resultimg file is not readable as a .bmp

Can anyone help
ps I want to modify/change shade of the .bmp and then save

Kind regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: .bmp

Post by Richard Russell »

Ric wrote: Sat 09 Nov 2024, 22:41 Does anyone know how to *LOAD and then *SAVE a .bmp file?
Generally what I do is *DISPLAY the .bmp image on the screen, make whatever modifications I need there, then *GSAVE it back to a file. That bypasses the need to know anything about the structure of the file itself. Admittedly that technique won't work if the image is bigger than the screen, making it impossible to *DISPLAY it in its entirety, but that's been rare in my experience.

Is there some reason why that approach won't work in your application?
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: .bmp

Post by Ric »

Thanks Richard, it worked perfectly.
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023