🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2229

Re: How to Put a Bitmap into a Dialog Box

#2229
From: M.L.M.Veraart
Date: Thu, 21 Jan 1993 07:59
33 lines
1687 bytes
kevin@iti.gov.sg (Kevin Patt (SE)) writes:

>Hi,

>    I want to put a bitmap into a Dialog Box, is there a way by making
>use of the Borland Resource Workshop? I could come up with a custom
>control to display the bitmap, I am just wondering is there an easier
>way?

>    Thanks!

Kevin, 

A solution is to make an edit control that has only a black frame or a
white frame. The size of this control is the size in pixels of the 
bitmap. In your InitDialog function you get the handle of this control
using a call to getItemHandle() and than a call to GetDC to get DC to
this control. Now you can use Bitblt() or Stretchblt() to paint the bitmap
in the dialog. This is the way that is used in PaintBrush when you set
the custom colors. They dynamiccally update the resulting color using the
same method.
If the dialog can be covered by another window you must process the
WM_PAINT also for the dialog in the same manner.

It works for me, I hope it will work for you to.

Mario Veraart
email:mveraart@fel.tno.nl
-- 
Mario Veraart                  TNO Physics and Electronics Laboratory
email: rioj7@fel.tno.nl        The Hague       The Netherlands
"If all else fails, show pretty pictures and animated videos, 
 and don't talk about performance",  David Bailey
Technical Details
Message-ID: <1993Jan21.075905.18179@fel.tno.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!tnofel!felfs!rioj7
References: <1993Jan14.132617.4897@iti.gov.sg>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!tnofel!felfs!rioj7
From: rioj7@fel.tno.nl (M.L.M.Veraart)
Subject: Re: How to Put a Bitmap into a Dialog Box
Organization: TNO Physics and Electronics Laboratory
Date: Thu, 21 Jan 93 07:59:05 GMT
Message-ID: <1993Jan21.075905.18179@fel.tno.nl>
References: <1993Jan14.132617.4897@iti.gov.sg>
Lines: 33