Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow transparency on Backglass, DMD and Background to active #35

Open
JockeJarre opened this issue Feb 22, 2023 · 10 comments
Open

Allow transparency on Backglass, DMD and Background to active #35

JockeJarre opened this issue Feb 22, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@JockeJarre
Copy link
Collaborator

It should be possible to activate transparency on Backglass, DMD and Background and set the TransparencyKey to a value from the PNG file included (for backglass and DMD) or loaded (for background)

@JockeJarre JockeJarre added the enhancement New feature or request label Nov 13, 2023
@tommkell
Copy link

tommkell commented Jan 2, 2024

Does this mean we could cut out where the alphanumerics go + add a transparent layer like shiny plastic, then have freezys in behind it? Would be unreal :)

@JockeJarre
Copy link
Collaborator Author

It has shown not to be that easy to solve, even if B2S supports it, there are so many other components involved which B2S does not control.

@tommkell
Copy link

tommkell commented Jan 3, 2024

I suppose it would have been done already if it was that easy! Thanks for the reply 👍

@5cutters
Copy link

As far as i can tell the base64 encoding for the images already includes transparency when the B2S files are created, it's just that they are then shown on top of a black form background.

A user defined RGB transparencykey could work for regular shapes but would probably have problems with alpha blending (so would allow fully opaque or fully transparent only)

A better(?) solution (more flexible but more complex) might be to use UpdateLayeredWindow type api calls - see example https://github.com/BCProgramming/AlphaSample

@JockeJarre
Copy link
Collaborator Author

work for regular shapes but would probably have problems with alpha blending (so would allow fully opaque or fully transparent only)
yes, you are right.

A better(?) solution (more flexible but more complex) might be to use UpdateLayeredWindow type api calls - see example

I compiled and it seems to do the work. You seem familiar with the technique? Any chance you can try it out?

@5cutters
Copy link

5cutters commented Mar 15, 2024

Not much time at the moment and i'm not overly familiar with the technique (i've seen it used so i know it exists but never used it myself), so might be a while before i get round to it.

@JockeJarre
Copy link
Collaborator Author

Would love to get some support even if it is just for short period to test out some new techniques... I did some different tries myself to get transparency into the forms, but it always failed that the main window only does one specific color transparent.

@5cutters
Copy link

I had a quick look at the code. Bad news i'm afraid, the B2S stuff appears to use a range of controls and graphics methods to update the displayed image on the form(s). As i understand it, for the 'layered' method to work it'd need to change to update a bitmap for the display instead, and that'd be a big old change. TransparencyKey with no alpha blending is probably the best option here as a winform project, so only one specific RGB value as transparent as you found :(

@JockeJarre
Copy link
Collaborator Author

thanks for your investigations. I found similar information in this. What I understand is WPF much better in handling transparency and it should be possible to mix WPF with win forms? Maybe that is an option?

Otherwise Jason (jsm174), working on the standalone version, has ported B2S to linux/SDL. So another option would be to port it back to windows, and then there might be a chance?

@5cutters
Copy link

Not much experience with WPF, but yes it is my understanding too that transparency handling (with alpha blending) would be a lot easier there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants