In GMapImage.cs
However SourceCopy would crash if you try to render text so it should be used temporary.
However SourceCopy would crash if you try to render text so it should be used temporary.
public override PureImage FromStream(Stream stream)
{
GMapImage ret = null;
try
{
#if !PocketPC
Image m = Image.FromStream(stream, true, Win7OrLater ? false : true);
using (Bitmap newBmp = new Bitmap(m))
{
m=newBmp.Clone(new Rectangle(0, 0, newBmp.Width, newBmp.Height), PixelFormat.Format32bppPArgb);
}
#else
Image m = new Bitmap(stream);
#endif
if(m != null)
{
ret = new GMapImage();
#if !PocketPC
ret.Img = ColorMatrix != null ? ApplyColorMatrix(m, ColorMatrix) : m;
#else
ret.Img = m;
#endif
}
}
catch(Exception ex)
{
ret = null;
Debug.WriteLine("FromStream: " + ex.ToString());
}
return ret;
}