# Map.DrawToBitmap Clips Output

**URL:** <https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392>\
**Category:** WinForms\
**Created:** [August 17, 2010, 5:45pm UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392 "2010-08-17T17:45:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 17, 2010, 5:45pm UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/1 "2010-08-17T17:45:37Z")

</div>

Hello,

I&nbsp;am&nbsp;having&nbsp;a&nbsp;"wombee"&nbsp;&nbsp;(works&nbsp;on&nbsp;my&nbsp;box)&nbsp;problem&nbsp;with&nbsp;the&nbsp;output&nbsp;of&nbsp;the&nbsp;DrawToBitmap&nbsp;functionality.&nbsp;The&nbsp;problem&nbsp;being&nbsp;that&nbsp;on&nbsp;my&nbsp;Windows&nbsp;7&nbsp;64bit&nbsp;box&nbsp;it&nbsp;works&nbsp;fine.&nbsp;I&nbsp;can&nbsp;get&nbsp;the&nbsp;bitmap&nbsp;from&nbsp;the&nbsp;form&nbsp;and&nbsp;then&nbsp;resize&nbsp;it&nbsp;to&nbsp;my&nbsp;desired&nbsp;size&nbsp;to&nbsp;be&nbsp;used&nbsp;in&nbsp;a&nbsp;thumbnail&nbsp;(map.bmp).&nbsp;However,&nbsp;when&nbsp;I&nbsp;move&nbsp;the&nbsp;application&nbsp;to&nbsp;a&nbsp;Windows&nbsp;2008&nbsp;Server&nbsp;64b&nbsp;&nbsp;it&nbsp;the&nbsp;resulting&nbsp;thumbnail&nbsp;comes&nbsp;out&nbsp;clipped&nbsp;(map\_clipped.bmp).&nbsp;I&nbsp;use&nbsp;the&nbsp;exact&nbsp;same&nbsp;library&nbsp;on&nbsp;both&nbsp;machines.&nbsp;Any&nbsp;idea&nbsp;as&nbsp;to&nbsp;what&nbsp;can&nbsp;be&nbsp;wrong.&nbsp;Here&nbsp;is&nbsp;the&nbsp;code&nbsp;used&nbsp;to&nbsp;create&nbsp;the&nbsp;thumbnail.

public&nbsp;Bitmap&nbsp;GetMapBitmap(int&nbsp;width,&nbsp;int&nbsp;height)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;now&nbsp;create&nbsp;the&nbsp;bitmap&nbsp;and&nbsp;pass&nbsp;it&nbsp;back  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bitmap&nbsp;bitmap&nbsp;=&nbsp;new&nbsp;Bitmap(Map.Width,&nbsp;Map.Height,PixelFormat.Format24bppRgb);  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bitmap&nbsp;mapBmp&nbsp;=&nbsp;new&nbsp;Bitmap(width,&nbsp;height,&nbsp;PixelFormat.Format24bppRgb);  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics&nbsp;gfx&nbsp;=&nbsp;Graphics.FromImage(mapBmp);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map.DrawToBitmap(bitmap,&nbsp;new&nbsp;Rectangle(0,&nbsp;0,&nbsp;Map.Width,&nbsp;Map.Height));

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gfx.DrawImage(bitmap,&nbsp;new&nbsp;Rectangle(0,&nbsp;0,&nbsp;width,&nbsp;height));

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;mapBmp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;

Any&nbsp;help&nbsp;is&nbsp;greatly&nbsp;appreciated.&nbsp;Thanks!

&nbsp;

Eric

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [August 18, 2010, 2:11am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/2 "2010-08-18T02:11:02Z")

</div>

Eric,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;questions.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Could&nbsp;you&nbsp;have&nbsp;a&nbsp;try&nbsp;to&nbsp;save&nbsp;bitmap&nbsp;after&nbsp;call&nbsp;the&nbsp;DrawToBitmap&nbsp;into&nbsp;disk&nbsp;and&nbsp;upload&nbsp;both&nbsp;of&nbsp;them&nbsp;here?&nbsp;It&nbsp;is&nbsp;very&nbsp;wield&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yang&nbsp;

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 18, 2010, 7:48am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/3 "2010-08-18T07:48:12Z")

</div>

Sorrry,&nbsp;I&nbsp;thought&nbsp;I&nbsp;had&nbsp;attached&nbsp;the&nbsp;bitmaps&nbsp;to&nbsp;the&nbsp;original&nbsp;post.&nbsp;Here&nbsp;they&nbsp;are:&nbsp;map.bmp&nbsp;(Windows&nbsp;2007&nbsp;64&nbsp;bit)&nbsp;and&nbsp;map\_clipped&nbsp;(Windows&nbsp;Server&nbsp;2008&nbsp;64&nbsp;bit).

Eric

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 18, 2010, 7:54am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/4 "2010-08-18T07:54:59Z")

</div>

Hmm,&nbsp;the&nbsp;attachments&nbsp;don't&nbsp;seem&nbsp;to&nbsp;be&nbsp;in&nbsp;my&nbsp;last&nbsp;post.&nbsp;Trying&nbsp;again.

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 18, 2010, 7:57am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/5 "2010-08-18T07:57:56Z")

</div>

The&nbsp;attachments&nbsp;don't&nbsp;seem&nbsp;to&nbsp;be&nbsp;working&nbsp;for&nbsp;me.&nbsp;I&nbsp;browse&nbsp;to&nbsp;the&nbsp;files&nbsp;and&nbsp;upload.&nbsp;&nbsp;It&nbsp;does&nbsp;indicate&nbsp;them&nbsp;as&nbsp;current&nbsp;attachments.&nbsp;However&nbsp;the&nbsp;options:&nbsp;Create&nbsp;Thumbnail,&nbsp;Inset&nbsp;Image&nbsp;and&nbsp;&nbsp;DIsplay&nbsp;Link&nbsp;do&nbsp;not&nbsp;indicate&nbsp;they&nbsp;are&nbsp;selected!?&nbsp;and&nbsp;I&nbsp;have&nbsp;no&nbsp;means&nbsp;to&nbsp;select&nbsp;them.&nbsp;Any&nbsp;help&nbsp;here?&nbsp;Thanks.

&nbsp;

Eric

&nbsp;

---

<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:** [August 18, 2010, 11:50am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/6 "2010-08-18T11:50:08Z")

</div>

If&nbsp;you&nbsp;are&nbsp;having&nbsp;difficulties&nbsp;attaching&nbsp;the&nbsp;file&nbsp;in&nbsp;the&nbsp;Discussion&nbsp;Forum&nbsp;post,&nbsp;please,&nbsp;send&nbsp;your&nbsp;file&nbsp;to&nbsp;[support@thinkgeo.com](mailto:support@thinkgeo.com).&nbsp;In&nbsp;the&nbsp;email,&nbsp;say&nbsp;to&nbsp;what&nbsp;post&nbsp;it&nbsp;is&nbsp;related&nbsp;to.&nbsp;Thank&nbsp;you.

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 18, 2010, 1:10pm UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/7 "2010-08-18T13:10:20Z")

</div>

I&nbsp;have&nbsp;emailed&nbsp;the&nbsp;files&nbsp;as&nbsp;directed.

&nbsp;

Eric&nbsp;S.

---

<div class="post-metadata">

**Author:** ![Ryan](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/a8b319/32.png) [@Ryan](https://community.thinkgeo.com/u/Ryan)\
**Post date:** [August 18, 2010, 1:25pm UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/8 "2010-08-18T13:25:05Z")

</div>

Eric's&nbsp;Comments:  
  
The&nbsp;map\_before.bmp&nbsp;is&nbsp;the&nbsp;output&nbsp;from&nbsp;Map.DrawToBitmp&nbsp;on&nbsp;a&nbsp;windows&nbsp;2008&nbsp;server&nbsp;64bit.&nbsp;As&nbsp;you&nbsp;can&nbsp;see&nbsp;it&nbsp;is&nbsp;already&nbsp;cropped&nbsp;before&nbsp;I&nbsp;do&nbsp;the&nbsp;resizing.&nbsp;The&nbsp;map.bmp&nbsp;is&nbsp;the&nbsp;end&nbsp;results&nbsp;on&nbsp;my&nbsp;windows&nbsp;7&nbsp;64&nbsp;bit&nbsp;box.&nbsp;The&nbsp;map\_clipped.bmp&nbsp;is&nbsp;the&nbsp;end&nbsp;result&nbsp;on&nbsp;the&nbsp;2008&nbsp;serever.  
  
  
  
Map:

 ![](https://community.thinkgeo.com/uploads/default/original/2X/6/63c0516c67095c6f5c8a12ad21751dee4af2ce55.png)  
  
  
  
Map&nbsp;Before:  
  
 ![](https://community.thinkgeo.com/uploads/default/original/2X/0/0b66857ccff9c1b736d61021bd61a30e064852f8.png)  
  
  
  
Map&nbsp;Clipped:  
  
 ![](https://community.thinkgeo.com/uploads/default/original/2X/c/c2af023c23b15b650d5bcbbacf9a4675269c31d0.png)

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 18, 2010, 4:52pm UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/9 "2010-08-18T16:52:42Z")

</div>

I&nbsp;have&nbsp;found&nbsp;a&nbsp;workaround&nbsp;to&nbsp;my&nbsp;problem,&nbsp;but&nbsp;&nbsp;it&nbsp;does&nbsp;not&nbsp;actually&nbsp;solve&nbsp;the&nbsp;problem.&nbsp;A&nbsp;little&nbsp;backstory&nbsp;first.&nbsp;I&nbsp;may&nbsp;shed&nbsp;some&nbsp;light&nbsp;as&nbsp;to&nbsp;why&nbsp;I&nbsp;am&nbsp;having&nbsp;the&nbsp;problem.&nbsp;One&nbsp;thing&nbsp;I&nbsp;did&nbsp;not&nbsp;mention&nbsp;was&nbsp;that&nbsp;the&nbsp;whole&nbsp;mapping&nbsp;process&nbsp;takes&nbsp;place&nbsp;in&nbsp;WCF&nbsp;service&nbsp;which&nbsp;is&nbsp;hosted&nbsp;by&nbsp;a&nbsp;Windows&nbsp;Service.&nbsp;I&nbsp;realized&nbsp;when&nbsp;I&nbsp;developed&nbsp;the&nbsp;service&nbsp;I&nbsp;should&nbsp;probably&nbsp;try&nbsp;out&nbsp;the&nbsp;MapEngine,&nbsp;but&nbsp;I&nbsp;had&nbsp;a&nbsp;very&nbsp;large&nbsp;class&nbsp;library&nbsp;that&nbsp;performed&nbsp;all&nbsp;my&nbsp;core&nbsp;mapping&nbsp;functionality,&nbsp;most&nbsp;importantly&nbsp;reading&nbsp;layer&nbsp;definitions&nbsp;from&nbsp;a&nbsp;layer&nbsp;metadata&nbsp;repository&nbsp;and&nbsp;dynamically&nbsp;adding&nbsp;them&nbsp;to&nbsp;the&nbsp;map,&nbsp;for&nbsp;our&nbsp;existing&nbsp;interactive&nbsp;winforms&nbsp;mapping&nbsp;application.&nbsp;I&nbsp;did&nbsp;not&nbsp;want&nbsp;to&nbsp;reinvent&nbsp;the&nbsp;wheel&nbsp;on&nbsp;this&nbsp;as&nbsp;MapEngine&nbsp;deals&nbsp;with&nbsp;layers&nbsp;completely&nbsp;different&nbsp;than&nbsp;WinformsMap.

So&nbsp;I&nbsp;thought&nbsp;that&nbsp;I&nbsp;would&nbsp;just&nbsp;create&nbsp;a&nbsp;parentless&nbsp;WinformsMap&nbsp;but&nbsp;never&nbsp;add&nbsp;it&nbsp;to&nbsp;anything.&nbsp;Something&nbsp;as&nbsp;simple&nbsp;as:

WinformsMap&nbsp;Map&nbsp;=&nbsp;new&nbsp;WinformsMap&nbsp;{Height&nbsp;=&nbsp;600,&nbsp;Width&nbsp;=&nbsp;400};

and&nbsp;use&nbsp;that&nbsp;as&nbsp;my&nbsp;map.&nbsp;In&nbsp;extensive&nbsp;testing&nbsp;on&nbsp;my&nbsp;Windows&nbsp;7&nbsp;64&nbsp;bit&nbsp;box&nbsp;it&nbsp;worked&nbsp;like&nbsp;a&nbsp;charm.&nbsp;I&nbsp;could&nbsp;create&nbsp;the&nbsp;map&nbsp;with&nbsp;my&nbsp;existing&nbsp;class&nbsp;libraries&nbsp;and&nbsp;simple&nbsp;Map.DrawToBitmap,&nbsp;convert&nbsp;to&nbsp;a&nbsp;smaller&nbsp;size&nbsp;and&nbsp;I&nbsp;had&nbsp;the&nbsp;thumbnail&nbsp;I&nbsp;needed.&nbsp;Things&nbsp;went&nbsp;south&nbsp;when&nbsp;I&nbsp;tried&nbsp;to&nbsp;implement&nbsp;on&nbsp;the&nbsp;Window&nbsp;2008&nbsp;server.&nbsp;I&nbsp;got&nbsp;the&nbsp;clipping&nbsp;behavior&nbsp;previously&nbsp;outlined&nbsp;in&nbsp;this&nbsp;post.

One&nbsp;interesting&nbsp;point&nbsp;to&nbsp;note,&nbsp;during&nbsp;initial&nbsp;testing&nbsp;of&nbsp;the&nbsp;WCF&nbsp;service&nbsp;on&nbsp;the&nbsp;2008&nbsp;server&nbsp;I&nbsp;was&nbsp;hosting&nbsp;my&nbsp;WCF&nbsp;service&nbsp;from&nbsp;a&nbsp;form&nbsp;and&nbsp;everything&nbsp;worked&nbsp;great,&nbsp;but&nbsp;as&nbsp;soon&nbsp;as&nbsp;I&nbsp;deployed&nbsp;using&nbsp;a&nbsp;Windows&nbsp;Service&nbsp;the&nbsp;output&nbsp;image&nbsp;got&nbsp;clipped.&nbsp;Maybe&nbsp;that&nbsp;difference&nbsp;may&nbsp;identify&nbsp;the&nbsp;problem.

My&nbsp;solution&nbsp;was&nbsp;to&nbsp;go&nbsp;ahead&nbsp;and&nbsp;not&nbsp;reinvent&nbsp;the&nbsp;wheel&nbsp;with&nbsp;new&nbsp;class&nbsp;libraries&nbsp;for&nbsp;MapEngine.&nbsp;I&nbsp;went&nbsp;ahead&nbsp;and&nbsp;created&nbsp;the&nbsp;Map&nbsp;using&nbsp;the&nbsp;parentless&nbsp;WinformsMap&nbsp;control,&nbsp;just&nbsp;as&nbsp;I&nbsp;had&nbsp;been,&nbsp;but&nbsp;instead&nbsp;of&nbsp;Map.DrawToBitMap&nbsp;I&nbsp;convert&nbsp;the&nbsp;contents&nbsp;of&nbsp;the&nbsp;WinformsMap&nbsp;to&nbsp;a&nbsp;MapEngine&nbsp;and&nbsp;get&nbsp;the&nbsp;bitmap&nbsp;from&nbsp;MapEngine.&nbsp;Once&nbsp;I&nbsp;thought&nbsp;it&nbsp;out&nbsp;the&nbsp;conversion&nbsp;was&nbsp;pretty&nbsp;simple.&nbsp;I&nbsp;have&nbsp;included&nbsp;the&nbsp;snippet&nbsp;of&nbsp;how&nbsp;I&nbsp;am&nbsp;doing&nbsp;this.&nbsp;&nbsp;Please&nbsp;note&nbsp;that&nbsp;I&nbsp;am&nbsp;accounting&nbsp;for&nbsp;specific&nbsp;overlays&nbsp;in&nbsp;my&nbsp;Winforms&nbsp;map&nbsp;and&nbsp;how&nbsp;they&nbsp;translate&nbsp;to&nbsp;mapEngine&nbsp;layers.

&nbsp;Hope&nbsp;this&nbsp;helps&nbsp;anyone&nbsp;who&nbsp;may&nbsp;have&nbsp;experienced&nbsp;this&nbsp;problem&nbsp;or&nbsp;highlights&nbsp;why&nbsp;the&nbsp;problem&nbsp;was&nbsp;occuring&nbsp;in&nbsp;the&nbsp;first&nbsp;place.

&nbsp;

Eric

`public MapEngine ConvertMapToEngine(){            MapEngine mapEngine = new MapEngine();            mapEngine.ShowLogo = false;            LayerOverlay layerOverlay;            foreach (Overlay overlay in Map.Overlays)            {                if (object.Equals(overlay.GetType(), typeof(LayerOverlay)))                {                    layerOverlay = (LayerOverlay)overlay;                    foreach (Layer layer in layerOverlay.Layers)                    {                        if (overlay.Name == "BaseMapOverlay")                            mapEngine.DynamicLayers.Add(layer);                        if (overlay.Name == "ImageOverlay")                            mapEngine.StaticLayers.Add(layer);                    }                }            }            mapEngine.CurrentExtent = Map.CurrentExtent;            return mapEngine; } public Bitmap GetMapBitmap2(int width, int height) {            MapEngine mapEngine = ConvertMapToEngine();            Bitmap bitmap = new Bitmap(width, height);            mapEngine.OpenAllLayers();            mapEngine.DrawStaticLayers(bitmap, Map.MapUnit);            mapEngine.DrawDynamicLayers(bitmap, Map.MapUnit);            mapEngine.CloseAllLayers();            bitmap.Save(@"C:\mapengine.bmp");            return bitmap;}`

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [August 20, 2010, 1:19am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/10 "2010-08-20T01:19:06Z")

</div>

Eric,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;sharing,&nbsp;I&nbsp;appreciate&nbsp;it&nbsp;very&nbsp;much.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;am&nbsp;glad&nbsp;seeing&nbsp;your&nbsp;workaround&nbsp;can&nbsp;solve&nbsp;your&nbsp;problem&nbsp;somehow.&nbsp;Now,&nbsp;it&nbsp;is&nbsp;very&nbsp;strange&nbsp;that&nbsp;as&nbsp;Ryan&nbsp;already&nbsp;has&nbsp;pointed&nbsp;out&nbsp;is&nbsp;that&nbsp;in&nbsp;windows&nbsp;2008&nbsp;server&nbsp;64&nbsp;bit,&nbsp;before&nbsp;resizing,&nbsp;it&nbsp;is&nbsp;already&nbsp;cropped&nbsp;and&nbsp;the&nbsp;left&nbsp;part&nbsp;lines&nbsp;of&nbsp;tiles&nbsp;seem&nbsp;missing.&nbsp;I&nbsp;am&nbsp;wondering&nbsp;this&nbsp;is&nbsp;only&nbsp;happening&nbsp;in&nbsp;your&nbsp;specified&nbsp;application&nbsp;or&nbsp;on&nbsp;any&nbsp;application&nbsp;as&nbsp;easy&nbsp;as&nbsp;Display&nbsp;only&nbsp;one&nbsp;shape&nbsp;file?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.thinkgeo.com/u/Eric_S)\
**Post date:** [August 20, 2010, 8:08am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/11 "2010-08-20T08:08:31Z")

</div>

A&nbsp;simple&nbsp;application&nbsp;on&nbsp;the&nbsp;2008&nbsp;server&nbsp;works&nbsp;fine.&nbsp;I'll&nbsp;reiterate&nbsp;a&nbsp;very&nbsp;specific&nbsp;circumstance.&nbsp;The&nbsp;WCF&nbsp;service&nbsp;I&nbsp;am&nbsp;using&nbsp;to&nbsp;generate&nbsp;the&nbsp;thumbnail&nbsp;works&nbsp;fine&nbsp;when&nbsp;I&nbsp;self-host&nbsp;the&nbsp;WCF&nbsp;service&nbsp;from&nbsp;a&nbsp;form.&nbsp;When&nbsp;I&nbsp;host&nbsp;the&nbsp;WCF&nbsp;service&nbsp;in&nbsp;a&nbsp;Windows&nbsp;Service,&nbsp;the&nbsp;cropping&nbsp;behavior&nbsp;occurs.&nbsp;(only&nbsp;on&nbsp;2008&nbsp;server&nbsp;64b,&nbsp;it&nbsp;works&nbsp;fine&nbsp;running&nbsp;as&nbsp;a&nbsp;Windows&nbsp;Service&nbsp;on&nbsp;Windows&nbsp;7&nbsp;64b).&nbsp;So&nbsp;it&nbsp;is&nbsp;very&nbsp;specific&nbsp;to&nbsp;something&nbsp;to&nbsp;the&nbsp;Windows&nbsp;Service&nbsp;hosted&nbsp;process.

I&nbsp;am&nbsp;using&nbsp;memory&nbsp;tiling&nbsp;for&nbsp;images,&nbsp;so&nbsp;an&nbsp;issue&nbsp;there&nbsp;could&nbsp;cause&nbsp;the&nbsp;cropped&nbsp;image,&nbsp;but&nbsp;not&nbsp;the&nbsp;shape&nbsp;as&nbsp;well?

For&nbsp;my&nbsp;current&nbsp;application&nbsp;I&nbsp;have&nbsp;a&nbsp;working&nbsp;solution.&nbsp;For&nbsp;any&nbsp;future&nbsp;map&nbsp;oriented&nbsp;WCF&nbsp;application&nbsp;development&nbsp;I'll&nbsp;definitely&nbsp;leverage&nbsp;MapEngine.

Still&nbsp;a&nbsp;mystery&nbsp;on&nbsp;your&nbsp;end.&nbsp;Good&nbsp;Luck.&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;support.

Eric.

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [August 23, 2010, 12:55am UTC](https://community.thinkgeo.com/t/map-drawtobitmap-clips-output/1392/12 "2010-08-23T00:55:00Z")

</div>

Eric,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;explanations.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Your&nbsp;application&nbsp;seems&nbsp;quite&nbsp;complicated,&nbsp;I&nbsp;appreciate&nbsp;it&nbsp;very&nbsp;much.&nbsp;I&nbsp;will&nbsp;take&nbsp;a&nbsp;try&nbsp;to&nbsp;see&nbsp;if&nbsp;I&nbsp;can&nbsp;catch&nbsp;the&nbsp;1%&nbsp;chance&nbsp;to&nbsp;recreate&nbsp;it,&nbsp;please&nbsp;do&nbsp;not&nbsp;hesitate&nbsp;to&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;the&nbsp;chance&nbsp;to&nbsp;create&nbsp;it&nbsp;in&nbsp;a&nbsp;simple&nbsp;case.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;
