home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5230 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.6 KB  |  44 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!mcsun!sun4nl!tnofel!felfs!rioj7
  3. From: rioj7@fel.tno.nl (M.L.M.Veraart)
  4. Subject: Re: How to Put a Bitmap into a Dialog Box
  5. Organization: TNO Physics and Electronics Laboratory
  6. Date: Thu, 21 Jan 93 07:59:05 GMT
  7. Message-ID: <1993Jan21.075905.18179@fel.tno.nl>
  8. References: <1993Jan14.132617.4897@iti.gov.sg>
  9. Lines: 33
  10.  
  11. kevin@iti.gov.sg (Kevin Patt (SE)) writes:
  12.  
  13. >Hi,
  14.  
  15. >    I want to put a bitmap into a Dialog Box, is there a way by making
  16. >use of the Borland Resource Workshop? I could come up with a custom
  17. >control to display the bitmap, I am just wondering is there an easier
  18. >way?
  19.  
  20. >    Thanks!
  21.  
  22. Kevin, 
  23.  
  24. A solution is to make an edit control that has only a black frame or a
  25. white frame. The size of this control is the size in pixels of the 
  26. bitmap. In your InitDialog function you get the handle of this control
  27. using a call to getItemHandle() and than a call to GetDC to get DC to
  28. this control. Now you can use Bitblt() or Stretchblt() to paint the bitmap
  29. in the dialog. This is the way that is used in PaintBrush when you set
  30. the custom colors. They dynamiccally update the resulting color using the
  31. same method.
  32. If the dialog can be covered by another window you must process the
  33. WM_PAINT also for the dialog in the same manner.
  34.  
  35. It works for me, I hope it will work for you to.
  36.  
  37. Mario Veraart
  38. email:mveraart@fel.tno.nl
  39. -- 
  40. Mario Veraart                  TNO Physics and Electronics Laboratory
  41. email: rioj7@fel.tno.nl        The Hague       The Netherlands
  42. "If all else fails, show pretty pictures and animated videos, 
  43.  and don't talk about performance",  David Bailey
  44.