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

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