Recent

Author Topic: Questions about 16 color bitmaps  (Read 232 times)

jamie

  • Hero Member
  • *****
  • Posts: 7829
Questions about 16 color bitmaps
« on: June 17, 2026, 12:27:21 pm »
I noticed the lclintf does not have any method to create a log palette and the bitmap class only has the HANDLE for the palette but no means to create it, did i get this correct?

 So i guess i need to use win32 api to create it, are 16 color images supported in other targets?

I use an offscreen bitmap to draw a full sized cad image to render it smoothly but i only need no more than 16 colors and would like  to keep memory usage low to enable this app to load several cad sheets.

 64 bit targets isnt a problem but i also want a 32 bit target.

Jamie
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: Questions about 16 color bitmaps
« Reply #1 on: June 17, 2026, 01:45:07 pm »
In my experience you should use fcl-image to work with 8bpp bitmaps: https://wiki.freepascal.org/fcl-image#Writing_an_8-bit_paletted_bitmap_file. The problem with TBitmap in the LCL functions is that its pixelformat is always expanded to 24 or 32 bpp.

When I have time, I'll try to write a bug report...

jamie

  • Hero Member
  • *****
  • Posts: 7829
Re: Questions about 16 color bitmaps
« Reply #2 on: June 18, 2026, 11:21:01 am »
I am interested in the background bit image using the true bit format, rendering can be what ever.

I can create a native bitmap in windows using a CreateDib function and connect a drvice context to it for rendering.

  I would assume the lcl can do the same, since it too can create dib bitmaps .

P.S.
  In my case i am interested in 16 color which is 2 pixels per byte.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018