Possible Issue with GetMap() And BackgroundImages

Topics: General Topics
Editor
Sep 27, 2011 at 12:23 PM

Hi all,

spent the last couple of hours trying to save a map, where the background layer is a image layer (Google, Bing or OSM). Problem arose when saving, where the background image was not being saved. Did a quick search of the duscussions and saw what i thought was a fix from version 98900 onwards, so downloaded the latest trunk, but that did solve it either. Also noticed that the the BackgroundImage property of MapBox is always null (i assume its doing something other than i thought i was), anyway i created the following property and it now returns the full map. Created a new one as, so not to create conflicts with the other code.

public Bitmap GetFullMapAsBitmap
        {
            get
            {
                try
                {
                    Bitmap B = new Bitmap(_imageBackground);
                    Graphics g = Graphics.FromImage(B);
                    g.DrawImageUnscaled(Map.GetMap(), 0, 0);
                    return B;
                }
                catch (Exception)
                {
                    return new Bitmap(Map.GetMap());
                }
            }
        }

Anyway, quick question - should the backgroundImage value always be null?