Page 1 of 1

Use transparency only on the Frame

Posted: Sun Sep 01, 2013 5:45 pm
by Intoxx
Hello, sorry for my English, i use frame (class MainFrame()) in my Program and i use this code :

Code: Select all

    wxColour *blue = new wxColour(2, 28, 45);
    SetBackgroundColour(*blue);

    wxButton *button = new wxButton(this, wxID_ANY, _T("Bouton"));
    wxButton *buttonB = new wxButton(this, wxID_ANY, _T("Bouton2"));
    wxButton *buttonC = new wxButton(this, wxID_ANY, _T("Bouton3"));
    buttonB->Move(150, 0);
    buttonC->Move(100, 55);

    SetTransparent(210);

     
    button->SetTransparent(255);
    buttonB->SetTransparent(255);
    buttonC->SetTransparent(255);
The transparency of the frame is good BUT the three buttons (button, buttonB, buttonC) are also (and i don't want.)

I don't find solution, thank's for your HELP !
Intoxx

Re: Use transparency only on the Frame

Posted: Sun Sep 01, 2013 6:27 pm
by doublemax
Sorry, not possible.

Re: Use transparency only on the Frame

Posted: Sun Sep 01, 2013 7:10 pm
by Intoxx
Really no alternative? To your knowledge is there another library allows?

Re: Use transparency only on the Frame

Posted: Sun Sep 01, 2013 7:38 pm
by doublemax
Really no alternative?
I had only one idea how to do this, but it's tricky and i'm not even sure it would work: Have two different wxFrames. One with the semitransparent background and on top of that, another "shaped" frame where only the parts where the buttons are, are visible. You'd have synchronize their relative position yourself.
To your knowledge is there another library allows?
Sorry, no idea.

Re: Use transparency only on the Frame

Posted: Sun Sep 01, 2013 8:01 pm
by Intoxx
I will try, thank's, this is good idea but a frame "Shaped" can have a transparent background? (RGB) I mean, is that the second frame that I would put above may have several controls while having an invisible background? (I look at the examples on the web now).

Thank's for your help men

Re: Use transparency only on the Frame

Posted: Sun Sep 01, 2013 8:07 pm
by doublemax
With a "shaped" frame (check the "shaped" sample), you can turn turn individual pixels on or off (1-bit mask). You'd have to create a mask where only the areas covered by the buttons are "active", the rest would be invisible. These would then "hover" over the semi-transparent background.

But even with this tricks it's not possible to have individual alpha values for each pixel.