Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

New Post: Performance Increase

$
0
0
In GMapImage.cs
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;
      }

Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>