ThinkGeo.com    |     Documentation    |     Premium Support

winformsMap.GetBitmap() method missing?

I am evaluating 3.0 beta. I was told I could convert maps to web graphics (gif, png, jpg) using a method called GetBitmap. However, I can not find that method. What am I missing here?



I just had a quick play, this seems to work, you can save it to anything the .NET framework supports in it's ImageFormat.


        Dim theBitmap As New Bitmap(Map.Bounds.Width, Map.Bounds.Height)
        Map.DrawToBitmap(theBitmap, Map.Bounds)
        theBitmap.Save("c:\test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)



Thanks Michael



Just made the C# version:


 



Bitmap bitmap = new Bitmap(winformsMap1.Bounds.Width, winformsMap1.Bounds.Height);
winformsMap1.DrawToBitmap(bitmap, winformsMap1.Bounds);
bitmap.Save(@"c:\test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);


glad I could help, 
  
 have a good one

Michael and Lars, Thanks for sharing!