Update GeoTaggedImage.WPF.cs

This commit is contained in:
Clemens 2022-01-09 16:51:59 +01:00
parent 577c39516f
commit 99c23d2ccd

View file

@ -64,7 +64,8 @@ namespace MapControl.Images
if (source.Format == PixelFormats.Indexed8 ||
source.Format == PixelFormats.Indexed4 ||
source.Format == PixelFormats.Indexed2)
source.Format == PixelFormats.Indexed2 ||
source.Format == PixelFormats.Indexed1)
{
targetFormat = source.Format;
colors = source.Palette.Colors.ToList();
@ -76,14 +77,19 @@ namespace MapControl.Images
}
else if (source.Format == PixelFormats.Gray4)
{
targetFormat = PixelFormats.Indexed8;
targetFormat = PixelFormats.Indexed4;
colors = BitmapPalettes.Gray16.Colors.ToList();
}
else if (source.Format == PixelFormats.Gray2)
{
targetFormat = PixelFormats.Indexed8;
targetFormat = PixelFormats.Indexed2;
colors = BitmapPalettes.Gray4.Colors.ToList();
}
else if (source.Format == PixelFormats.BlackWhite)
{
targetFormat = PixelFormats.Indexed1;
colors = BitmapPalettes.BlackAndWhite.Colors.ToList();
}
if (colors == null || transparentPixel >= colors.Count)
{