Thread View: comp.os.ms-window.programmer.win32
2 messages
2 total messages
Started by bob
Thu, 10 Dec 1998 00:00
A 24bit Color bitmap
Author: bob
Date: Thu, 10 Dec 1998 00:00
Date: Thu, 10 Dec 1998 00:00
16 lines
1369 bytes
1369 bytes
Hello, I need to have a DC with a 24bit color bitmat in any windows screen modes (16 Color, 256 Color, 16bit color, ...) then draw my drawing (with 24bit color pens) in it. I can create a 24bit color bitmat and select it for any DC (CreateBitmap, SelectObject). But when I finish my drawing and save this bitmat to disk, there is no drawing in it! I don't want this DC be visible. Drawings is in background. I mean, how can a program produce a 24bit color image file while is running under 256 colors Windows mode? Thanks very much. Bob Daneshfar bob@dpi.net.ir
Re: A 24bit Color bitmap
Author: Earl F. Glynn
Date: Thu, 10 Dec 1998 00:00
Date: Thu, 10 Dec 1998 00:00
32 lines
2300 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads