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

Images in controls #1708

Open
EFEaglehouse opened this issue Sep 29, 2023 · 2 comments · May be fixed by #1851
Open

Images in controls #1708

EFEaglehouse opened this issue Sep 29, 2023 · 2 comments · May be fixed by #1851
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-framework/svc in-pr Pri1 High priority, do before Pri2 and Pri3 winforms/subsvc

Comments

@EFEaglehouse
Copy link

EFEaglehouse commented Sep 29, 2023

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

@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Sep 29, 2023
@issues-automation issues-automation bot added dotnet-framework/svc winforms/subsvc Pri1 High priority, do before Pri2 and Pri3 labels Sep 29, 2023
@adegeo
Copy link
Contributor

adegeo commented Oct 4, 2023

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.

@adegeo adegeo added the doc-enhancement Improve the current content [org][type][category] label Oct 4, 2023
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Oct 4, 2023
@adegeo
Copy link
Contributor

adegeo commented Oct 31, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-framework/svc in-pr Pri1 High priority, do before Pri2 and Pri3 winforms/subsvc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants