?
Solved

How do I make my Picture control bitmap TRANSPARENT?

Posted on 1997-05-25
4
Medium Priority
?
458 Views
Last Modified: 2013-12-03
Hi,

How do I make part(s) of my Picture control bitmap transparent?

It's positioned on top of a dialog box in a Windows '95 app.

I have tried setting the background colour to be the same as
the parts of the bitmap I want to be transparent (in MSVC++
Graphics editor), and setting the control's "transparent"
extended style, but the whole image stays resolutely opaque...

I don't know if it's relevant or not, but there is a static
(opaque) text control sitting on top of the picture control as
well. However, this only obscures a small part of the picture
control and doesn't cover the bits I want to be transparent.

Anyone?
0
Comment
Question by:wagtail
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:laleonard
ID: 1163698
I assume you want to make it transparent so that a control (say, a pushbutton) will show though...  if not, you might send us a snippet of the DIALOG code from the RC file...In the Graphics Editor, select the "Layout, Tab Order" menu item, and make sure that the picture control has a lower number than the (say, pushbutton) control that you're try to "reveal".  Also, be sure the picture control does *not* have the transparent style set.
0
 

Author Comment

by:wagtail
ID: 1163699
Hi laleonard,

Thanks for your reply.

Basically I have a bitmap which is non-rectangular in shape. There aren't any controls behind it to show through, just the plain background colour of the dialog itself.

I want to make sure that the bits around the edges of my bitmap are transparent, eg they show up as the same colour as the user's dialog background (whatever that might be).

All the "cutaway" bits of the bitmap are set to the same colour - I thought it was just a matter of making this the background colour in Graphics Editor, but I was wrong!

Here's the snippet from the RC file. I presume the picture control is the one right at the end of the list...

IDD_SAVER_DIALOG DIALOG DISCARDABLE  0, 0, 248, 210
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Saver Config"
FONT 8, "MS Sans Serif"
BEGIN
    GROUPBOX        "Pen",IDC_STATIC,5,6,113,70
    LTEXT           "Width",IDC_STATIC,11,22,30,8
    EDITTEXT        IDC_EDIT_WIDTH,51,20,40,13,ES_AUTOHSCROLL
    LTEXT           "End Style",IDC_STATIC,11,40,36,8
    COMBOBOX        IDC_CAP_STYLE,51,38,61,41,CBS_DROPDOWNLIST | WS_VSCROLL |
                    WS_TABSTOP
    GROUPBOX        "Resolution",IDC_STATIC,5,79,113,40
    LTEXT           "Low",IDC_STATIC,14,92,30,8
    RTEXT           "High",IDC_STATIC,77,92,30,8
    SCROLLBAR       IDC_SCROLLBAR_RES,14,103,94,11,WS_GROUP | WS_TABSTOP
    GROUPBOX        "Speed",IDC_STATIC,5,121,113,40
    LTEXT           "Slow",IDC_STATIC,14,134,30,8
    RTEXT           "Fast",IDC_STATIC,77,134,30,8
    SCROLLBAR       IDC_SCROLLBAR_SPEED,14,145,94,11,WS_GROUP | WS_TABSTOP
    DEFPUSHBUTTON   "OK",IDOK,137,14,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,137,31,50,14
    CONTROL         "",IDC_PREVIEW,"Static",SS_SIMPLE,134,83,76,56
    PUSHBUTTON      "Color...",IDC_BUTTON_COLOR,137,49,50,14
    LTEXT           "Join Style",IDC_STATIC,11,58,36,8
    COMBOBOX        IDC_JOIN_STYLE,51,56,61,41,CBS_DROPDOWNLIST | WS_VSCROLL |
                    WS_TABSTOP
    CONTROL         136,IDC_STATIC,"Static",SS_BITMAP,126,74,18,20
END
0
 
LVL 4

Accepted Solution

by:
AVaulin earned 150 total points
ID: 1163700
How about this way: use AVI which suuport transparent background instead bitmap. CAnimateCtrl class give possibilities to work with AVI. I hope it can help.
0
 

Author Comment

by:wagtail
ID: 1163701
Thanks AVaulin,

You got me moving again. I looked at CAnimateCtrl then decided to go for CImageList which allowed me to do it without creating a .AVI.

Cheers,

   Gil

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question