home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / tools / 870 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  1.4 KB

  1. Path: sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!amber!dialup.athena.lkg.dec.com!mills
  2. From: mills@athena.lkg.dec.com (George Mills)
  3. Newsgroups: comp.os.ms-windows.programmer.tools
  4. Subject: Trying to read in 256 color .BMP file
  5. Message-ID: <mills.715656976@dialup.athena.lkg.dec.com>
  6. Date: 5 Sep 92 01:36:16 GMT
  7. Distribution: usa
  8. Lines: 19
  9.  
  10. I have application that I've been working on for a while that uses NO
  11. palettes. It can read and write 16 color .BMPs fine. Now I'm adding palattes
  12. so that the application can handle 256 color .BMPs. I have the display working
  13. fine and the "paint" routines etc. I can read the .BMP in, add it's colors
  14. to my palette and "directly" send it to the screen with SetDIBitsToDevice.
  15. Sending to the screen directly was only a sanity check. I really want to
  16. copy it to a particular location within the backing-store bitmap. If I bitblt
  17. it into the backing store I only get 16 colors.
  18.  
  19. What is the proper procedure for copying a small DIB into a larger one
  20. and keeping the palettes straight. I've tried using 
  21.  
  22. BitBlt (only 16 colors, not surprised)
  23. SetDIBIts (some thing show up, compressed into a couple scan lines)
  24. SetDIBitsToDevice (works directly to screen, nothing shows copying to DIB) 
  25. StretchDIB (same as above)
  26.  
  27. To add the colors to the palette I loop through .bmicolors[0..n] and add
  28. them if not already in the palette.
  29.