🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools
Article #210

Trying to read in 256 color .BMP file

#210
From: George Mills
Date: Sat, 05 Sep 1992 01:36
19 lines
1415 bytes
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.
Technical Details
Message-ID: <mills.715656976@dialup.athena.lkg.dec.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!amber!dialup.athena.lkg.dec.com!mills

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!amber!dialup.athena.lkg.dec.com!mills
From: mills@athena.lkg.dec.com (George Mills)
Newsgroups: comp.os.ms-windows.programmer.tools
Subject: Trying to read in 256 color .BMP file
Message-ID: <mills.715656976@dialup.athena.lkg.dec.com>
Date: 5 Sep 92 01:36:16 GMT
Distribution: usa
Lines: 19