mirror of
https://github.com/DarthAffe/HPPH.git
synced 2026-11-09 18:36:34 +00:00
Fixed wrong image format when loading 32bit bitmaps
This commit is contained in:
1 parent
0a731b5ca4
commit
8fd2ee7091
1 file changed
+1
-1
@@ -75,7 +75,7 @@ public static class ImageExtension
|
|||||||
if (data.PixelFormat.HasFlag(PixelFormat.Format24bppRgb))
|
if (data.PixelFormat.HasFlag(PixelFormat.Format24bppRgb))
|
||||||
image = Image<ColorRGB>.Create(buffer, data.Width, data.Height, data.Stride);
|
image = Image<ColorRGB>.Create(buffer, data.Width, data.Height, data.Stride);
|
||||||
else if (data.PixelFormat.HasFlag(PixelFormat.Format32bppArgb))
|
else if (data.PixelFormat.HasFlag(PixelFormat.Format32bppArgb))
|
||||||
image = Image<ColorARGB>.Create(buffer, data.Width, data.Height, data.Stride);
|
image = Image<ColorRGBA>.Create(buffer, data.Width, data.Height, data.Stride);
|
||||||
else throw new NotSupportedException($"Unsupported pixel format '{bitmap.PixelFormat}'.");
|
else throw new NotSupportedException($"Unsupported pixel format '{bitmap.PixelFormat}'.");
|
||||||
|
|
||||||
bitmap.UnlockBits(data);
|
bitmap.UnlockBits(data);
|
||||||
|
|||||||
Reference in new issue
Block a user