Article View: comp.os.ms-windows.programmer.tools
Article #236Re: Trying to read in 256 color .BMP file
From: sg6934331
Date: Tue, 08 Sep 1992 08:06
Date: Tue, 08 Sep 1992 08:06
21 lines
1791 bytes
1791 bytes
In article <mills.715656976@dialup.athena.lkg.dec.com>, mills@athena.lkg.dec.com (George Mills) writes: > I have application that I've been working on for a while that uses NO > palettes. It can read and write 16 color .BMPs fine. Now I'm adding palattes > so that the application can handle 256 color .BMPs. I have the display working > fine and the "paint" routines etc. I can read the .BMP in, add it's colors > to my palette and "directly" send it to the screen with SetDIBitsToDevice. > Sending to the screen directly was only a sanity check. I really want to > copy it to a particular location within the backing-store bitmap. If I bitblt > it into the backing store I only get 16 colors. > > What is the proper procedure for copying a small DIB into a larger one > and keeping the palettes straight. I've tried using > > BitBlt (only 16 colors, not surprised) > SetDIBIts (some thing show up, compressed into a couple scan lines) > SetDIBitsToDevice (works directly to screen, nothing shows copying to DIB) > StretchDIB (same as above) > > To add the colors to the palette I loop through .bmicolors[0..n] and add > them if not already in the palette. The code to read 256 bmp file is provided in Microsoft Windows SDK.
Technical Details
Message-ID:
<1992Sep8.160645.1@ntuvax.ntu.ac.sg>Path:
arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!jvnc.net!nuscc!ntuix!ntuvax.ntu.ac.sg!sg6934331References:
<mills.715656976@dialup.athena.lkg.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!jvnc.net!nuscc!ntuix!ntuvax.ntu.ac.sg!sg6934331 From: sg6934331@ntuvax.ntu.ac.sg Newsgroups: comp.os.ms-windows.programmer.tools Subject: Re: Trying to read in 256 color .BMP file Message-ID: <1992Sep8.160645.1@ntuvax.ntu.ac.sg> Date: 8 Sep 92 08:06:45 GMT References: <mills.715656976@dialup.athena.lkg.dec.com> Sender: news@ntuix.ntu.ac.sg (USENET News System) Distribution: usa Organization: Nanyang Technological University - Singapore Lines: 21 Nntp-Posting-Host: v9001.ntu.ac.sg