ThinkGeo.com    |     Documentation    |     Premium Support

Layer.VectorImage in MapSuite 3.0

Hi,


In 2.0 to create a vector image of layers I used to use the 'VectorImage' property to get the vector image of each layer, which I then merged myself to create a meta file.  I've included a code snippit to give you an idea of what I did in 2.0 and I don't see an obvious equivalent method in 3.0




  public Image GetMapImage()
        {       
            //Set the full extent
            map.CurrentExtent = map.FullExtent;
            map.Refresh();

            //Merge all the vector images together
            List<Image> imagesToMerger = ObjectPooler.Get<List<Image>>();

            foreach( Layer layer in map.Layers )
                imagesToMerger.Add(layer.VectorImage);

            return GraphicsHelper.MergeImagesIntoMetafile(imagesToMerger);
        }


Actually any way to get an image even if its a bitmap would be good.



I've tried the 'LayerDrawn' even on the map control, but it doesn't appear to be called.


'OverlayDrawn' on the static overlay on the map control does get me an image (from the native image param), but its not just for the current extent.


I'm going to try the DrawToBitmap method on the WinformsMap control, but from the doc it looks like a method from control.


There really needs to be a simple way to at least get the current visable map as bitmap, vector would be better.  This was fairly simple in 2.0, but seems to be a pain in 3.0.  I really like the ability to create your own customer layer types (have done 2 already) in 3.0 so I don't have to write shps or images to disk to load, but some things seem quite difficult or at least obscured.


Thanks

Brian



The DrawToBitmap on WinForms seems to work fine, but I don't see an method like it on the WPF map control...which is really were I need it.  Please consider adding more support for exporting maps an images and specificly in a vector format.  I see you have that for PDFs, but just as a meta file would be very much appericated



Brian, 
  
 Thanks for pointing this out. We’ve added your requests to our tracking system; we will consider adding more support for exporting maps in next version.  
  
 Thanks, 
 ThinkGeo Support 


Brian, 
  
 We have added DrawToBitmap method in wpfMap, please get the latest version of DesktopEdition(development branch 4.5.151.0) and have a try. 
  
 Thanks, 
  
 James