Alpha channel transparent

Byak@

Active Member
Licensed User
on Desktop.
for example we have transparent formex (TransparencyKey) and now we draw png image with alpha transparent. but our alpha thrasparent now has color as TransparencyKey.
how can be done alpha transparent? (NOT OPACITY!!!!)

i'm see it in miranda and it is very nice))
exampleoo1.jpg
 

agraham

Expert
Licensed User
Longtime User
how can be done alpha transparent? (NOT OPACITY!!!!)
What's the difference?

This is not easily possible, even with the Door library. For a Form to support alpha transparency ir needs to have its ControlStyle SupportsTransparentBackColor set True, the default is False.

From MSDN : SupportsTransparentBackColor : If true, the control accepts a BackColor with an alpha component of less than 255 to simulate transparency.

Unfotunately the Forms' method, SetStyle, that does this is not a Public method and can only be called by another method belonging to the Form. It is not accessible to the Door library :(
 

Byak@

Active Member
Licensed User

Byak@

Active Member
Licensed User
of course! this is a big plus for basic4ppc and this will further bring it to other programming languages

i'm look forward to this :-[
 

agraham

Expert
Licensed User
Longtime User
i'm look forward to this :-[
Disappointment then I'm afraid. I tried this yesterday and SupportsTransparentBackColor doesn't work on a Form in the way expected :(. Googling around other people have tried this and found the same. It seems the only way to do it is to take over drawing the Form yourself at a low-level.
 

Byak@

Active Member
Licensed User
i'm don't understand =((
 

Byak@

Active Member
Licensed User
:-(
Erel what you say about it?it is very important for me =(((
 

sitajony

Active Member
Licensed User
And if in C# we take a screenshot and we paste Control's image on the screenshot with the sames coordination and size and we return the final image? i'm building a lib for this...
The transparency will could real and maybe the opacity too...
 

ExcludeReality

Active Member
Licensed User
That kind of transparency shouldn't be too hard to achive. Just take a screenshot before you show the form, cut out the part where the form will be positioned and turn down the brightness a bit. Then apply the image to the form. Of course, if the background changes the form will not adapt, unless you tie this routin to a timer event
 

Byak@

Active Member
Licensed User
Of course, if the background changes the form will not adapt, unless you tie this routin to a timer event
Yes, i'm do it some month ago and it is work fine,see sample)
 

Attachments

  • ATest.zip
    2.4 KB · Views: 246

sitajony

Active Member
Licensed User
Else we can just field an PictureBox in the Function and we hide this picturebox, get the picturebox's image, take a screenshot in the same location/dimension and modify the picturebox's image with the screenshot and the original image and show the picturebox...
I'll try...
 

Byak@

Active Member
Licensed User
eeem...what differense with my sample and why hide PictureBox?
 
Top