`Cursor.Draw` draws with broken alpha channel
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 20h 23m
- Merged PRs (30d)
- 103
Description
### .NET version
7.0.400
### Did it work in .NET Framework?
No
### Did it work in any of the earlier releases of .NET Core or .NET 5+?
_No response_
### Issue description
`Curosor.Draw` draws with broken alpha channel:
Result:

Expected:

Also reported here more that 10 years ago: https://stackoverflow.com/questions/4451839/how-to-render-a-transparent-cursor-to-bitmap-preserving-alpha-channel
### Steps to reproduce
```cs
Cursor cursor = Cursors.AppStarting;
Bitmap bitmap = new Bitmap(cursor.Size.Width, cursor.Size.Height, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(bitmap);
cursor.Draw(g, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
bitmap.Save(Path.Combine(Directory.GetCurrentDirectory(), "cursor.png"), ImageFormat.Png);
```
This code with `Icon.FromHandle` and `Icon.ToBitmap` works as expected:
```cs
Cursor cursor = Cursors.AppStarting;
Icon icon = Icon.FromHandle(cursor.Handle);
Bitmap bitmap = icon.ToBitmap();
bitmap.Save(Path.Combine(Directory.GetCurrentDirectory(), "icon.png"), ImageFormat.Png);
```
Contributor guide
Assessment
This issue has not been assessed yet.