🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-window.programmer.win32
Article #2

Re: A 24bit Color bitmap

#2
From: Earl F. Glynn
Date: Thu, 10 Dec 1998 00:00
32 lines
2300 bytes
Bob:

bob wrote in message <9812109132.AA913266673@dpi.net.ir>...
>I mean, how can a program produce a 24bit color image file while is running
>under 256 colors Windows mode?

It's easy to create a pf24bit TBitmap in memory in any color mode, but it's a bit of a pain to display such a bitmap in 256 color
mode.

A 24-bit bitmap has all the color information stored in each pixel -- it doesn't need a palette.  A 24-bit image can have thousands
of colors in it.  So the challenge is to pick the best 236 colors for display in 256 color mode.  (In 256 color mode, Windows
normally reserves 20 colors for its use.)

So you need a palette to display your pf24bit bitmap in 256 color mode.  See the Show Demo One Lab Report for an example of how to
do this.  This only create a palette for display of the 24-bit bitmap, it doesn't reduce the pf24bit bitmap to a pf8bit bitmap.
http://www.efg2.com/lab/Graphics/Colors/ShowDemoOne.htm

For other info about palettes in Delphi, look for "Palettes" in the Color section of
http://www.efg2.com/lab/library/Delphi/Graphics/Algorithms.htm

For general info about palettes in Windows, look at the "Palettes" section of
http://www.efg2.com/lab/Library/Color.htm   In particular, look at the links to the Microsoft "Q" reports "Palette Manager:  How and
Why It Does What it Does" and "Palettes Self-Study Module."

Happy Holidays,
efg
_________________________________
efg's Computer Lab:       www.efg2.com/lab
Delphi Books:  www.efg2.com/lab/TechBooks/Delphi.htm

Earl F. Glynn     E-Mail:  EarlGlynn@att.net
Overland Park, KS  USA
Technical Details
Message-ID: <74oln5$so4@bgtnsc02.worldnet.att.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <9812109132.AA913266673@dpi.net.ir>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1683be,7343bded9731cbcf
X-Google-Attributes: gid1683be,public
X-Google-Thread: fc8d0,7343bded9731cbcf
X-Google-Attributes: gidfc8d0,public
X-Google-Thread: 10a296,7343bded9731cbcf
X-Google-Attributes: gid10a296,public
From: "Earl F. Glynn" <EarlGlynn@att.net>
Subject: Re: A 24bit Color bitmap
Date: 1998/12/10
Message-ID: <74oln5$so4@bgtnsc02.worldnet.att.net>
X-Deja-AN: 420809562
References: <9812109132.AA913266673@dpi.net.ir>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
Organization: AT&T WorldNet Services
Newsgroups: comp.os.ms-window.programmer.win32,borland.public.delphi.graphics,alt.winsock.programming