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

  1. Xref: sparky comp.os.ms-windows.programmer.misc:1799 comp.os.ms-windows.programmer.tools:941 comp.os.ms-windows.programmer.win32:930
  2. Newsgroups: comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools,comp.os.ms-windows.programmer.win32
  3. Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!tad
  4. From: tad@wrq.com (Tad Marshall)
  5. Subject: Re: How to change color of a .bmp file upon loading 
  6. Message-ID: <1992Sep12.160549.23121@u.washington.edu>
  7. Keywords: Change color of a bitmap file
  8. Sender: news@u.washington.edu (USENET News System)
  9. Organization: Walker Richer & Quinn, Inc., Seattle, WA
  10. References: <1992Sep12.051058.16495@nuscc.nus.sg>
  11. Distribution: na
  12. Date: Sat, 12 Sep 1992 16:05:49 GMT
  13. Lines: 14
  14.  
  15. In article <1992Sep12.051058.16495@nuscc.nus.sg> shah@cherry.NoSubdomain.NoDomain (shahrin abdullah) writes:
  16. >I would like to know whether is there a function in the SDK which allows me
  17. >to change the color of a bitmap after loading.
  18.  
  19. A .BMP file is a device independent bitmap (DIB) with a BITMAPFILEHEADER at
  20. its start.  This header is followed by some bitmap parameters, a palette,
  21. and the actual bitmap bits.  It's all quite well documented -- in the win31
  22. sdk, look in volume 3 on pages 236-241 under BITMAPFILEHEADER, BITMAPINFO
  23. and BITMAPINFOHEADER.  To change the colors in a bitmap, load the DIB into
  24. memory, modify or copy the header, palette and/or bitmap bits as you wish
  25. and then use SetDIBits, SetDIBitsToDevice or StretchDIBits to display the
  26. resulting DIB.
  27.  
  28. Tad Marshall
  29.