Transparent Form with 2 PNG images with Alpha Channel

A

Allan

I've been trying to get this to work for days. I have a form which needs to
be transparent (only the form background). On the form there are two images
(32 bit PNGs) with alpha channel information, in one case the alpha
information is used to display a shadow, and the other has a shadow and a
few other things. One of these images will change on a random basis (every
five minutes or so) and the other is the background for display data.

If on the main form, I set the TransparencyKey and the Background color the
same, I can get the transparent form, but there is a problem with the
images. The alpha channel data (in this case the shadow), shows as the same
color as the TransparencyKey. I've tried the UpdateLayeredWindow (took care
of the alpha channel) but it seems only to work for a single image, i.e.
this API needs a single bitmap as a source, and once you use it, nothing
else can be done with the form. Alphablend doesn't seem to work, can't get
the background around the image to be transparent.

Has anyone any idea how to get this to work? Most examples I've seen use
updatelayeredwindow and only use a single image.

Thanks in advance
 
F

Fergus Cooney

Hi Allan,

I was away over the weekend. and nobody has picked up on your query. If
you could post a cut-down version of your project with the Form and the two or
three of your pngs, I'll have a play and we'll see if we can work this out
together?

Make it a zip so that I can just load and go. If it's big, you can post it
to me direct (but post a message here too so that I know to go and check the
mail - it's full of virus emails at the moment).

Regards,
Fergus
 
F

Fergus Cooney

Hi Allan,

Your message has come in just as I'm tying up loose ends and going to bed.
I'll give it a look tomorrow. No promises - I'm no expert in this area. But
I'm curious and interested. :)

Later Dude,
Fergus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top