Frantic
Frantic

Reputation: 1179

wxWidgets custom window shape (PNG)

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 :(

Upvotes: 4

Views: 2442

Answers (3)

ezpresso
ezpresso

Reputation: 8136

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 :(

Upvotes: 0

RSabet
RSabet

Reputation: 6160

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

Upvotes: 2

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

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

Upvotes: 0

Related Questions