-
Notifications
You must be signed in to change notification settings - Fork 169
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
Images in controls #1708
Comments
Hi @EFEaglehouse yeah the article is definitely more generic as it's talking about the "background" property and not specifically transparent hosted content such as images or icons. I think it would be a good idea to add information about the picturebox control since that's a common scenario. However, we're not really going back through and updating .NET Framework articles as we're more focused on porting them to .NET 6/7/8. As part of porting this content (when it happens) we would improve the article. I'll leave this issue open to track it during porting. |
Also note, it's very common for a BMP to only have 24-bit pixel data, which doesn't include an alpha channel for transparency. |
Type of issue
Missing information
Description
The instructions on this page are a little too brief. It mentions nothing about the image having to have transparency or an alpha channel. Even with that information, it's hit or miss for BMP images and probably other formats; however, it works for a PNG. Load a PNG image containing transparent areas into a PictureBox, set the PictureBox.BackColor = Color.Transparent and the transparency shows through the image to what's underneath.
Hard to believe we still have to struggle with transparency these days.
Page URL
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-give-your-control-a-transparent-background?view=netframeworkdesktop-4.8
Content source URL
https://github.com/dotnet/docs-desktop/blob/main/dotnet-desktop-guide/framework/winforms/controls/how-to-give-your-control-a-transparent-background.md
Document Version Independent Id
9f6948a4-9abc-2d40-cd1d-d28ca2df18e8
Article author
@adegeo
The text was updated successfully, but these errors were encountered: