Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

System.Drawing.Image.FromStream returns a Bitmap with incorrect PixelFormat #22

@AndrewKaplanovsky

Description

@AndrewKaplanovsky

Hi Anders, so sorry for disturbing you again.

I have an image stored on a disk, .bmp file with PixelFormat = Format1bppIndexed.
I try to load this file from Stream in my UWP application:

using (Stream stream = ResourcesUtils.GetResourceByID(ResourcesUtils.RES_BOARDMASK_20x20))
{
Bitmap bmpMask = (Bitmap)System.Drawing.Image.FromStream(stream);
...
}

When I check the PixelFormat of bmpMask, it's Format32bppArgb.

Is this a correct behavior or a bug in Shim.Drawing?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions