Advanced Transparency

nikini
07-17-2006, 06:35 AM
I'm new in VB.NET (I know VB6 though). Check out the PNG I attached to this post. I want to make a form that has a shadow just like the buttons's png.

I tried like this: I set the transparent color to white and the form background color to white. And I imported the png into a picture box. Transparency worked fine but for the shadow. The shadow was supposed to be semitransparent and the blur shoul also have a transparent background.

If someone understands, please help. If someone wants, i will attach creenshots. Just ask me. Thanks in advance for help.

Iceplug
07-17-2006, 07:01 PM
Yes, I knew from the title of thread that this was yet another picturebox problem.

So, you want the shadow of the picture to blend into the background of the form? I think your best bet is to either try to set up a region for a picturebox with the picture inside, or draw the PNG yourself (assuming that the PNG has transparency) and you'll have to handle the clicking part yourself. :)

nikini
07-29-2006, 02:41 AM
the png is already fine and drawn as to blend in the background! See what happens..(in the image I attached)

Iceplug
07-31-2006, 04:35 PM
So, did you still have a problem here or did I misunderstand your last post?

nikini
08-01-2006, 07:14 AM
i did not properly understand what you first told me to do..:D so if you could explain.. I tried at my last post to explain my exact problem! Hope someone can help me..:D

Iceplug
08-06-2006, 05:38 AM
Well, if you are still having problems drawing this shape, I think an easy possible solution would be to apply a color matrix that will turn the white part into transparency. Since you don't want the yellow to transform (Red + Green = Yellow), that leaves Blue.

Ref: http://www.iceplug.us/cngdi6.htm
The color matrix would be:
[ 1, 0, 0, 0, 0 ]
[ 0, 1, 0, 0, 0 ]
[ 0, 0, 1, 1, 0 ]
[ 0, 0, 0, 1, 0 ]
[ 0, 0, 0, 0, 1 ]

:)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum