# Export of the map

**URL:** <https://community.thinkgeo.com/t/export-of-the-map/947>\
**Category:** WinForms\
**Created:** [January 6, 2010, 5:22am UTC](https://community.thinkgeo.com/t/export-of-the-map/947 "2010-01-06T05:22:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre-Antoine](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/pierre-antoine/32/24983_2.png) [@Pierre-Antoine](https://community.thinkgeo.com/u/Pierre-Antoine)\
**Post date:** [January 6, 2010, 5:22am UTC](https://community.thinkgeo.com/t/export-of-the-map/947/1 "2010-01-06T05:22:05Z")

</div>

Hello,

I&nbsp;want&nbsp;to&nbsp;know&nbsp;how&nbsp;I&nbsp;can&nbsp;export&nbsp;my&nbsp;map&nbsp;?&nbsp;Like&nbsp;the&nbsp;function&nbsp;GetBitmap()&nbsp;in&nbsp;the&nbsp;Web&nbsp;Edition.

I&nbsp;want&nbsp;to&nbsp;create&nbsp;an&nbsp;image&nbsp;of&nbsp;my&nbsp;map&nbsp;like&nbsp;I&nbsp;see&nbsp;it&nbsp;with&nbsp;all&nbsp;the&nbsp;layers.

&nbsp;

Thanks&nbsp;in&nbsp;advance.

Pierre-Antoine

---

<div class="post-metadata">

**Author:** ![Pierre-Antoine](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/pierre-antoine/32/24983_2.png) [@Pierre-Antoine](https://community.thinkgeo.com/u/Pierre-Antoine)\
**Post date:** [January 6, 2010, 5:51am UTC](https://community.thinkgeo.com/t/export-of-the-map/947/2 "2010-01-06T05:51:25Z")

</div>

I&nbsp;found&nbsp;how&nbsp;to&nbsp;do&nbsp;it&nbsp;:

`Bitmap image = new Bitmap(winformsMap1.ClientSize.Width, winformsMap1.ClientSize.Height);winformsMap1.DrawToBitmap(image, winformsMap1.ClientRectangle);image.Save(@"c:\test.bmp");`

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [January 6, 2010, 5:30pm UTC](https://community.thinkgeo.com/t/export-of-the-map/947/3 "2010-01-06T17:30:45Z")

</div>

I&nbsp;am&nbsp;glad&nbsp;you&nbsp;figured&nbsp;it&nbsp;out.&nbsp;To&nbsp;extent&nbsp;on&nbsp;that&nbsp;idea,&nbsp;you&nbsp;can&nbsp;use&nbsp;the&nbsp;graphics&nbsp;object&nbsp;of&nbsp;the&nbsp;image&nbsp;to&nbsp;draw&nbsp;an&nbsp;outline,&nbsp;drw&nbsp;some&nbsp;text&nbsp;for&nbsp;the&nbsp;title&nbsp;of&nbsp;the&nbsp;map&nbsp;etc.&nbsp;The&nbsp;code&nbsp;below&nbsp;was&nbsp;written&nbsp;very&nbsp;rapidly&nbsp;but&nbsp;you&nbsp;see&nbsp;how&nbsp;you&nbsp;could&nbsp;draw&nbsp;your&nbsp;own&nbsp;legend,&nbsp;title&nbsp;etc&nbsp;on&nbsp;the&nbsp;image&nbsp;using&nbsp;Graphics.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bitmap&nbsp;image&nbsp;=&nbsp;new&nbsp;Bitmap(winformsMap1.Width&nbsp;+&nbsp;40&nbsp;,&nbsp;winformsMap1.Height&nbsp;+&nbsp;50);&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics&nbsp;g&nbsp;=&nbsp;Graphics.FromImage(image);&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g.DrawRectangle(new&nbsp;Pen(Color.Black),&nbsp;new&nbsp;Rectangle(2,&nbsp;2,&nbsp;winformsMap1.Width&nbsp;+&nbsp;36,&nbsp;winformsMap1.Height&nbsp;+&nbsp;46));&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g.DrawString("MY&nbsp;MAP",&nbsp;new&nbsp;Font("Arial",&nbsp;12,&nbsp;FontStyle.Regular),&nbsp;new&nbsp;SolidBrush(Color.Black),&nbsp;new&nbsp;PointF(250,&nbsp;10));&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;winformsMap1.DrawToBitmap(image,&nbsp;new&nbsp;Rectangle(20,40,&nbsp;winformsMap1.Width,&nbsp;winformsMap1.Height));&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;image.Save(@"c:\temp\test.bmp");
