4

I'm using wxPython bindings for wxWidgets. Is it possible to create custom-shaped window from PNG image and in count alpha-channel? Take a look at VS2010 splash screen to see what I mean:

alt text

Highlighted zones (rounded corner and shadow) are not sharp, they use alpha-channel to look smooth.

Update: I want not only custom shape, but smooth custom shape

Update 2: Seems like there is no way to do this with wx :(

Frantic
  • 1,179
  • 11
  • 25

3 Answers3

2

Have a look at the shapedwindow from the docs and demos of wxpython

RSabet
  • 6,130
  • 3
  • 27
  • 26
0

If you want a Splash screen you can use the AdvancedSplash class which supports masking.

Shay Erlichmen
  • 31,691
  • 7
  • 68
  • 87
  • According to it's doc, "AdvancedSplash frame will have the shape defined only by non-transparent pixels". And that means no partial transparency, no smooth shape. – Frantic Oct 11 '10 at 13:30
0

As far as I know there is at least one way of accomplishing this:

  1. Construct a splash window, but do not show it (just construct and init). This window should be borderless and should have some margins for future shadow' gradients.
  2. Grad the portion of an underlaying window to an image.
  3. Show the splash window. Paint the stored image, draw the shadows and the splash picture with all the transparent stuff you need.

However this method is only suitable for splash screens :(

ezpresso
  • 7,896
  • 13
  • 62
  • 94