dotnet / dotnet/winforms

Bitmap class should have transparency informations when loading from file

Open
#8,825 5 comments 0 reactions 0 assignees View on GitHub
area-System.Drawing
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

* .NET Core Version:

.NET SDK (gemäß "global.json"):
Version: 5.0.103
Commit: 72dec52dbd

Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.103\

Host (useful for support):
Version: 5.0.3
Commit: c636bbdc8a

* Have you experienced this same bug with .NET Framework?:
Yes

**Problem description:**
Bitmap class has no transparency informations (alpha channel) when loading from file or stream with an alpha channel..

**Expected behavior:**
![PictureBoxViews](https://user-images.githubusercontent.com/28147549/107550713-a8d80b80-6bd1-11eb-96dd-d2ccfc3fa509.PNG)
The left side is the current situation. The right side is the expected one.

**Minimal repro:**
[TestBitmap.zip](https://github.com/dotnet/winforms/files/5960339/TestBitmap.zip)
See possible solution in file AlphaBitmap.cs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.