png image but background is not transparent
Can somebody help me out?
The original image is attached
16 Replies
I have a problem.
I have a png but the background is not transparent as presented in the attached img.
If you have an answer please ping me ^^ :pepeOkayThumb:
What exactly are you trying to do?
Just posting two pictures and saying "background is not transparent" doesn't give anyone useful info.
If that helps kind a bit
Is this WPF? WinForms?
c# win forms with .net
What is the background color of your picturebox?
Winforms doesn't exactly support transparency, not very well at least.
Should be transparent.
Yeah i think thats the problem i‘m running into :hidethepain:
Set the BackColor to transparent too
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-give-your-control-a-transparent-background?view=netframeworkdesktop-4.8
Hm, I‘ll try it later after I‘m home from work :harold:
But it isn't a button.
Can you show me with a little snippet what you mean? 😄
Button has nothing to do with it
all controls have a BackColor property
Okay
Can you give me a little snippet of what you mean?
Like insert it into the snippet if its that what you mean?
No.
Read the docs
Thanks a lot for your comment but the parameter with .BackColor = Color.Transparent doesn't work
Pretty sure you don't actually want
image.MakeTransparent(Color.Transparent);
you use that to make a color that is NOT already transparent into a transparent color. For example changing solid pure white to transparent. It has been a long time since I've dealt with this, so take that with a grain of salt.
Also, why add a picturebox to the control isntead of just setting the background of the control? If you really need the picturebox, then make the picturebox background transparent too at the very least.@Motley I think I already tried that but it doesn’t work