I have a windows form application, and I have extended the window's frame into the client area using DwmExtendFrameIntoClientArea to get the glass effect.
Now I'm trying to show a transparent PNG image in a picture box, however the background shows up as white instead of the glass effect. How can i make the image show as transparent so that i only see the rounded gray rectangle and not the white background.
My screenshot is below. Thanks.
<img alt="alt text" class="b-lazy" data-src="https://i.stack.imgur.com/Ra6o8.png" data-original="https://i.stack.imgur.com/Ra6o8.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />
<img alt="alt text" class="b-lazy" data-src="https://i.stack.imgur.com/xkeyH.png" data-original="https://i.stack.imgur.com/xkeyH.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />Answer1:
Ok, this is a kind of easy to fix problem with winforms.....what you have to do, like blam said is set the transparency key to something like: R:1, G:2, B:3...this makes everything inside your form drawn in that color transparent...all you need to do then is set the background color of your imagebox to that color...and it should draw the image's background transparently (as long as your image has transparency)Answer2:
Make it whatever the colour key for the glass is: Black iirc.