Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64 V3.9.0 Pondering what might be there?
#18
(09-20-2023, 10:06 PM)bplus Wrote:
(09-20-2023, 07:51 PM)SMcNeill Wrote: BMP files at offset 28 in the header, stores 2 bytes which represent your image type...

"the number of bits per pixel, which is the color depth of the image. Typical values are 1, 4, 8, 16, 24 and 32."

So 32-bit BMPs are supported, which allows you to make any transparency level alpha you want in your image.  They're just not very common as 24-bit tends to be used with most BMPs.

@SMcNeill I am using your SaveImage Bi and BM and modified your demo to my purpose. And I am guessing, no I will bet real money, your setup for .BMP's was for 24 bit.

Smile  Is my money safe?

Aye.  You can see from the source:

Code: (Select All)
        CASE 4
            temp = SPACE$(3)
            OffsetBITS& = 54 'no palette in 24/32 bit
            BMP.BPP = 24

I remember asking back when I first put out the SaveImage library if anyone wanted/needed the 32-bit version where you could save the Alpha info.  Folks told me to skip it as it'd just add to the complexity of things and would make the image files 33% larger.  Since I also didn't bother to work up the cheesy little RLE compression, files could get a little large with full screen captures, and for some reason QB64 tends to attract a certain crowd where anything larger than 1 byte offends them.   

"I don't need an IDE!  I can make QB64 1.23 bytes smaller without it, and only ever use CLI!"  

"Whut?!  Why don't we support the -compressMyAssOff flag?!  It only takes 3 weeks to compile Hello World, but it can break it down to being 2 bits smaller!"  

"Whuuuttt?!!  Make a flexible library would an user could specify whether they want to save alpha levels, or not?  Require an extra parameter?!!  Add 20 lines of code to ALL my programs?!!  I'll never need that!  It's just BLOAT!!  BLOAT I TELL YOU!!  IT'S AGAIST TEH SPITIRT OF BASIC!!!!!"

And so, I produced the most universal and simplest of interfaces for the greatest majority of folks to use.  Just the ultra bare bones for image saving.

Your money is safe.  My library only does 256 color or 24-bit image saves.  Sad (In BMP mode. PNGs still save the full 32-bits of information.)
Reply


Messages In This Thread
RE: QB64 V3.9.0 Pondering what might be there? - by SMcNeill - 09-21-2023, 12:29 AM



Users browsing this thread: 2 Guest(s)