Transparent bitmap in dialog box

Hi!

I want to display a bitmap in a dialog box. I use the resource editor to
specify the bitmap. How can I make the bitmap transparent? For example; all
white areas should have the same color as the dialog window.

Regards
/Anders


0
8/21/2003 12:23:28 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1418 Views

Similar Articles

[PageSpeed] 21

I remember seeing examples on how to do this but for the life of me I now
cannot find them!

Try looking at:

www.codeproject.com
www.codeguru.com

Larry

"Anders W�hlin" <anders.wahlin@erv.ericsson.se> wrote in message
news:bi2div$25b$1@newstree.wise.edt.ericsson.se...
> Hi!
>
> I want to display a bitmap in a dialog box. I use the resource editor to
> specify the bitmap. How can I make the bitmap transparent? For example;
all
> white areas should have the same color as the dialog window.
>
> Regards
> /Anders
>
>


0
lsiddens (35)
8/21/2003 12:59:16 PM
I posted a response on this to another message a few days ago.  It's really
very easy.  Just take a look at CBitmap::LoadMappedBitmap().  It only works
for bitmaps with a palette but that shouldn't create too great a problem
unless your dialog is 1024x768 pixels and your goal was to render a
photograph on it.  For the specifics you could simply over-ride the painting
of the background by filling the background with the 3D face colour then
rendering your mapped bitmap (having mapped your background palette entry to
the 3D face colour).

"Anders W�hlin" <anders.wahlin@erv.ericsson.se> wrote in message
news:bi2div$25b$1@newstree.wise.edt.ericsson.se...
> Hi!
>
> I want to display a bitmap in a dialog box. I use the resource editor to
> specify the bitmap. How can I make the bitmap transparent? For example;
all
> white areas should have the same color as the dialog window.
>
> Regards
> /Anders
>
>


0
mairda (55)
8/23/2003 3:11:27 AM
Reply:

Similar Artilces:

Text box validation 01-04-08
I have a form with several text boxes that I want to check for duplicate values in the table. The PK inthe table is an Autonumber. What I want to do is not allow the FirstName LastName FileNo and SSN to be the same for any two records. The combination of these fields would garuntee that the same individual would not be allowed to have two records created. You could set a unique index in the underlying table on those four fields. This would disallow the entry of duplicates (but only after the fact -- after the user entered values and tried to save them). Another approach would be to g...

Dialog based application and generated OnPaint for the dialog class
Hello, I'm using MSVC++ 8.0 SP1 and I created a dialog based MFC application using the application wizard. In my CDialog-derived class, MyDialog, the appwizard generated the following OnPaint() for me: // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void MyDialog::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc....

Update Text Box Value
Maybe a simple question Can anyone tell me how I go about updating other text boxes from an input in one text box ?? I have an emloyee number that links to personnel information about an individual .. I would like to enter a pay number in one box ... click a button and their name etc is presented in the other boxes ... Can anyone enlighten me please Many thanks Hi Alan, '----------------------------------- > Maybe a simple question > > Can anyone tell me how I go about updating other text boxes from an input > in > one text box ?? > > I have an emloyee numb...

Transparent bitmap in dialog box
Hi! I want to display a bitmap in a dialog box. I use the resource editor to specify the bitmap. How can I make the bitmap transparent? For example; all white areas should have the same color as the dialog window. Regards /Anders I remember seeing examples on how to do this but for the life of me I now cannot find them! Try looking at: www.codeproject.com www.codeguru.com Larry "Anders W�hlin" <anders.wahlin@erv.ericsson.se> wrote in message news:bi2div$25b$1@newstree.wise.edt.ericsson.se... > Hi! > > I want to display a bitmap in a dialog box. I use the resou...

In Box
Hi, The in box groups emails by date....can I have it simply list all email without any grouping or sorting? thank you Well, it has to be sorted in some fashion -- unless you want them to just be listed randomly which makes no sense. You can turn off grouping though. View | Arrange By...uncheck "Show in Groups." Aloha, -Ben- Ben M. Schorr, OneNote-MVP Roland Schorr & Tower http://www.rolandschorr.com Microsoft Outlook FAQ: http://www.factplace.com/outlook.htm **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replie...

How do you cancel a combo box update?
I want to put some code in the BeforeUpdate event of a combo box control on a form in Access 2000. In certain predefined conditions, this code should cancel the combo box change and ensure that the combo box remains at its previous setting. I had assumed that setting the Cancel property to True would do this but it doesn't seem to work. I feel sure that a very simple solution is staring me in the face but it's late at night and the brain is starting to shut down. Any ideas? David David Anderson wrote: >I want to put some code in the BeforeUpdate event of a combo box cont...

Open Dialog has changed
Hello When I click open the file listing has changed... For instance If I sort by filename the files are sorted but there is a line that says "A" then all the A files, a "B" then all the B Files etc. This is happening in all office applications but not in windows explorer. Has anyone seen this before and how to I retore it? Operating System has a lot to do with what Views are available, but if you select View in the dialog box you should have your choice there. Thanks wrote: > Hello > When I click open the file listing has changed... > For ins...

transparencies are printing opaque instead of transparent
All shadows and pictures set on color transparent, transparent gradient, or a certain percentage transparent, are printing opaque instead of transparent. It shows up transparent on the file when I set it, but shows opaque in the print preview mode, and then prints opaque as well. ...

Font letter & numbers turning in to empty square boxes
Pub 2003 started to change numbers into empty square boxes. The problem is I have 16 pages and to create or carry over the info would take 2 days to fix. It appears it happens in the present file but the same info in a new pub file works. There are no viruses. XP OS 1 What causes this? 2 Can I import or copy the present file into a new pub2003 filw w/o bringing over the corruption? The troublesome font is Arial Narrow / Garamond but it works fine in all other programs. 3 Can I repair the present pub 2003 file? I have twiddled with this and I can't find anything on the web. It could be a ...

drawing anywhere onscreen by using transparent window?
Hi, I am looking for an example of how to create a transparent window that I can position anywhere on the screen and draw to it using the GDI. So basically it would look like I am drawing on the screen over top of everything, but really I am just drawing to my transparent window. Anyone know how to do this and/or know where there is an example of how to do this? Thanks, gman you can make window with WS_POPUP style or use as a parent HWND_DESKTOP. Then override its OnEraseBkgnd and return TRUE - this should stop CWnd from filling background with white color. All drawing do in OnPai...

How to draw line between to boxes
I am very new to Visio. I am trying to draw a flow chart. I have drawn the boxes and now I want to connect them by lines. There is an "Arrow" tab in left side pane for shpaes but it seams that it is something different. Where is the draw line command? -- Rasoul Khoshravan Azar Civil Engineer Osaka, Japan On Mon, 27 Mar 2006 16:37:01 -0800, Khoshravan <khoshravan@discussions.microsoft.com> wrote: >I am very new to Visio. I am trying to draw a flow chart. I have drawn the >boxes and now I want to connect them by lines. There is an "Arrow" tab in >left s...

Custom base class for dialog
I have a base class derived from CDialog, let's call it CMyDialog. CMyDialog implements basic functionality that a large group of my dialogs need to have. One common member is a CGridCtrl (another derived class), that implements subitem editing. My issue comes to having handlers that respond to LVN_BEGINLABELEDIT as well as LVN_ENDLABELEDIT. To use the message map functionality I need to have some identifier such as IDC_LIST1. The problem of course is that CMyDialog doesn't have access to this value. The other problem is that perhaps the CGridCtrl members doesn't have the same dia...

transparent object does not print out transparent
I have created a circle (with the circle tool) that has varient shading. It's orange in the center and fades out to transparent. I have a second object sitting behind my circle. While I am working on the document, the object appears as I have designed it, but whent I go to print, the object becomes solid and the transparent part becomes white, hiding the second object behind. Can anyone help me figure out how to print it out as a transparent object? Thanks! This is a known bug in Publisher 2002/2003 along with the rest of Office XP/Office 2003. Group the objects together, then ...

how do you change font size in message box
i would like to change the font size of a message box generated in an excel macro Look about half way down through this article. http://www.contextures.com/xlDataVal10.html thanks for the speedy reply but thats a combo box am using msgbox to display results at the end of the macro run and wondered if i can increase the font size MsgBox ("Stats Updated" & Chr(13) & ordersok & Chr(13) & inhandok & Chr(13) & percompok) "DNA" wrote: > Look about half way down through this article. > > http://www.contextures.com/xlDataVal10.html > ...

GetPixel() and items in a dialog window
I am attempting to use GetPixel() on every pixel of a window to generate a bitmap. I know its not the best way of doing it in general, but this is a CE app and it was the easiest way of getting a bitmap. Anyway, my function takes a CWnd* to the window that I want to generate a bitmap of. When I look at the bitmap file, I see the dialog window just fine but other items in the window just show up as blank rectangles. I see no buttons, static text, edit boxes, list boxes, etc. Just blank spaces where they should be. Is there a way to have GetPixel() return everything from a dialog as well a...

Combo box on web pages
When I make a web page with excel combo boxes are just an image . How can I use combo boxes in web and I want to use the cell link of it that the user could't see it . thank you . Use Dreamweaver to design web pages and use the 'Form objects' and th 'List/Menu'. This will allow you to use a drop down menu. You can loo at this link for and example http://www.p-c-surgeon.com/Page-Files/support.htm -- P-C-Surgeo ----------------------------------------------------------------------- P-C-Surgeon's Profile: http://www.excelforum.com/member.php?action=getinfo&useri...

multiple item select from a combo box
I want to use this as a navigational tool, rather than to "input" values into a database. This control will be on a form that sets parameters for graphical chart displays. One of the requirements is to be able to select multiple values from a 2nd combo box after a 'parent' 1st combo box determines what should be in the 2nd one. I have a couple of ideas of how to do this, but was just wondering if someone has already tackled something like this before. I suppose I could populate a temporary table that has yes/no values in it and display that in a subform (which scroll...

common bitmap resources (localization)
Hi, Currently, I am doing localization for my application using satellite dlls. WindowsCE is the target platform so I have to take a special care about the memory consumption. I would like to do bitmap resources common for all languages (hence I will separate strings and dialogs only). The problem is that MFC functions reads from application set handle (so I would have to do AfxSetResourceHandle before and after CBitmap::LoadBitmap). On the other hand using GDI LoadBitmap I would have to care about memory dealocation, etc. I would like to share the bitmap resources in a smart way? Could you ...

Dialog Box from DLL
Hello, I am very new to C,C++, and Win32 and MFC. I need to create a dll that is called by another program that provides a few specific services. I have successfully created the dll with the exception of one aspect. When the setup functionality is called, a dialog box needs to be displayed so the user can verify/provide setup information. I have created a dialog box via Insert/Resource and have used the class wizard to create a class based on this dialog box and methods for applicable windows messages. I have not yet placed any additional code in these methods. I cannot for the life of ...

Furniture Boxes moving Los Angeles movers
Furniture Boxes moving Los Angeles movers GET FREE QUOTES from professional moving companies in your area Licensed & Insurance 1. Long Distance Moving -Save on your Move 6 or more movers compete for your move. Sit Back and receive calls from Movers who want to compete for your move. http://www.sunshine-mhs.com [domain info] Sponsored Result 2. Compare Movers - Save Money Get free quotes from movers in your area. Save up to 65% off of regular rates! http://www.linksmoving.com [domain info] Sponsored Result 3. Movers Get free estimate from multipl moving companies at the same time, Licensed ...

Image with transparent background
Is it possible to have an image on a button in MFC with a transparent background? How do I do this? Also, how are images stored in MFC applications? Are they compiled into the exe? What is the compression like? Maybe you could use this class: http://www.softechsoftware.it/cbuttonst.html Tom "Bart" <xyz@abc.com> wrote in message news:OIMef.18911$lJ.13991@newsfe5-win.ntli.net... > Is it possible to have an image on a button in MFC with a transparent > background? How do I do this? > > Also, how are images stored in MFC applications? Are they compiled into ...

Add Bitmap to Button
Hi Pls. let me know about adding Bitmap to Button Regards jasmin See CBitmapButto Bitte Sehr Have you seen the CBitmapButton class? "Jasmin" <anonymous@discussions.microsoft.com> wrote in message news:2F893C07-A72C-4F5D-AE6D-7E19C839DC90@microsoft.com... > Hi! > > Pls. let me know about adding Bitmap to Button. > > Regards, > jasmin Hi Jasmin I found the following answer to your question at the webpage http://www.mvps.org/vcfaq/mfc/5.htm Q : How do I display a bitmap on a button? A : You can use a bitmap or an icon on a button, although an icon is ...

Transparent CStatic on Dialog with image in background
Hi everyone! I'm developing a little program for windows mobile (think problem should be the same for Win32) in MFC and have problems displaying a dialog with an JPEG-image in the background and placing some transparent CStatic's above it. Here is what I dit: BOOL CMyDialog::OnEraseBkgnd(CDC * pDC) { BOOL bRet = CDialog::OnEraseBkgnd(pDC); // draw background image CComPtr<IImagingFactory>pFactory; HRESULT hr = pFactory.CoCreateInstance(CLSID_ImagingFactory); IImage* pImg; hr = pFactory->CreateImageFromFile(_T("\\myBackImage.jpg"), &pImg); RECT a; a.bott...

Where's the Services... dialog?
I got a problem. My drive died and when I reinstalled Outlook 2000 the Tools->Services... item has changed to Tools->Accounts and I can't use that. I have to set up different profiles including different mail servers and personal folders because I run several email bots whose mail absolutely must be kept separate from mine. How do I get Services back? -SHAWN- You need to change modes (you want corporate/workgroup and not internet mail only mode). More info on how to do is here: http://www.slipstick.com/outlook/choosingmode.htm "Shawn Fessenden" <shawn@testech-lt...

No Password Dialog
I have a user who put a password on the spreadsheet. When most users open it, it prompts them for a password and provides a "Read only" button. She wants everyone else to have read-only access but a few she has shared the password with. When one of our users opens the file it never prompts her for a password, it just opens up. She cannot save any changes, so it must be read-only for her, but they want the pop-up to show. Any suggestions. If that workbook is saved on a network share and the user doesn't have write access to that folder, then excel/windows is smart enough to ...