|
@@ -269,7 +269,13 @@ namespace InABox.WPF
|
|
|
public static BitmapImage AsBitmapImage(this Bitmap src, bool transparent = true)
|
|
|
{
|
|
|
if (transparent)
|
|
|
- src.MakeTransparent(src.GetPixel(0, 0));
|
|
|
+ {
|
|
|
+ var pixel = src.GetPixel(0, 0);
|
|
|
+ if(pixel.A == byte.MaxValue)
|
|
|
+ {
|
|
|
+ src.MakeTransparent(pixel);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
var bitmapImage = new BitmapImage();
|
|
|
using (var memory = new MemoryStream())
|