# Labels show through LegendPrinterLayer

**URL:** <https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635>\
**Category:** WinForms\
**Created:** [November 18, 2015, 12:11pm UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635 "2015-11-18T12:11:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/steven1/32/18983_2.png) [@Steven1](https://community.thinkgeo.com/u/Steven1)\
**Post date:** [November 18, 2015, 12:11pm UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/1 "2015-11-18T12:11:59Z")

</div>

Hi&nbsp;guys,  
  
  
  
We&nbsp;are&nbsp;having&nbsp;a&nbsp;problem&nbsp;when&nbsp;printing&nbsp;maps&nbsp;using&nbsp;the&nbsp;PrinterLayers.&nbsp;We&nbsp;are&nbsp;using&nbsp;MS&nbsp;9.0.0.142.  
  
  
  
If&nbsp;we&nbsp;print&nbsp;a&nbsp;page&nbsp;layout&nbsp;using&nbsp;map&nbsp;layers&nbsp;with&nbsp;labels,&nbsp;the&nbsp;labels&nbsp;show&nbsp;through&nbsp;the&nbsp;background&nbsp;mask&nbsp;of&nbsp;the&nbsp;legend,&nbsp;even&nbsp;though&nbsp;the&nbsp;background&nbsp;mask&nbsp;is&nbsp;solid,&nbsp;not&nbsp;transparent.&nbsp;We&nbsp;also&nbsp;see&nbsp;this&nbsp;happening&nbsp;when&nbsp;we&nbsp;create&nbsp;LabelPrinterLayers.&nbsp;Since&nbsp;BackgroundMask&nbsp;is&nbsp;a&nbsp;property&nbsp;of&nbsp;the&nbsp;base&nbsp;class&nbsp;it&nbsp;would&nbsp;not&nbsp;surprise&nbsp;me&nbsp;if&nbsp;all&nbsp;PrinterLayers&nbsp;have&nbsp;this&nbsp;behavior.  
  
  
  
I&nbsp;have,&nbsp;of&nbsp;course,&nbsp;attached&nbsp;a&nbsp;sample&nbsp;project.  
  
  
  
Thanks!  
  
  
  
Steve  
  
[004\_003\_002\_001\_LegendSizeTest.zip](https://community.thinkgeo.com/uploads/default/original/1X/fe9a4154e9127a30a9adf740a9550e17ccaeb16d.zip) (93.2 KB)

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [November 19, 2015, 4:26am UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/2 "2015-11-19T04:26:10Z")

</div>

Hi&nbsp;Steven,  
  
  
  
I’m&nbsp;not&nbsp;sure&nbsp;whether&nbsp;we&nbsp;understood&nbsp;you&nbsp;correctly,&nbsp;but&nbsp;when&nbsp;we&nbsp;tested&nbsp;the&nbsp;sample&nbsp;you&nbsp;attached&nbsp;with&nbsp;MS&nbsp;9.0.0.142,&nbsp;we&nbsp;were&nbsp;unable&nbsp;to&nbsp;recreate&nbsp;the&nbsp;problem,&nbsp;we&nbsp;did&nbsp;set&nbsp;the&nbsp;BackgroundMask&nbsp;as&nbsp;a&nbsp;SolidBrush,&nbsp;but&nbsp;the&nbsp;background&nbsp;of&nbsp;legend&nbsp;is&nbsp;not&nbsp;transparent,&nbsp;just&nbsp;as&nbsp;expected.  
  
  
  
Thanks,  
Johnny

---

<div class="post-metadata">

**Author:** ![Steven1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/steven1/32/18983_2.png) [@Steven1](https://community.thinkgeo.com/u/Steven1)\
**Post date:** [November 19, 2015, 6:53am UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/3 "2015-11-19T06:53:38Z")

</div>

Thanks&nbsp;for&nbsp;your&nbsp;response.&nbsp;&nbsp;  
  
  
  
I&nbsp;want&nbsp;to&nbsp;make&nbsp;sure&nbsp;you&nbsp;understood&nbsp;that&nbsp;the&nbsp;problem&nbsp;only&nbsp;happens&nbsp;if&nbsp;you&nbsp;print&nbsp;the&nbsp;map.&nbsp;On&nbsp;the&nbsp;screen&nbsp;it&nbsp;looks&nbsp;fine.&nbsp;I&nbsp;have&nbsp;attached&nbsp;a&nbsp;pdf&nbsp;of&nbsp;what&nbsp;it&nbsp;looks&nbsp;like.  
  
  
  
Thanks!&nbsp;  
  
  
  
Steve  
  
  
  
  
[layout.pdf](https://community.thinkgeo.com/uploads/default/original/2X/7/7c936dbb2eb1c6b89a3a7edab64f8697d29a2b4a.pdf) (122 KB)

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [November 20, 2015, 2:57am UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/4 "2015-11-20T02:57:27Z")

</div>

Hi&nbsp;Steven,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;that,&nbsp;I&nbsp;have&nbsp;reproduced&nbsp;that,&nbsp;but&nbsp;we&nbsp;need&nbsp;some&nbsp;time&nbsp;to&nbsp;see&nbsp;where&nbsp;is&nbsp;the&nbsp;problem&nbsp;and&nbsp;how&nbsp;to&nbsp;solve&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;update&nbsp;I&nbsp;will&nbsp;let&nbsp;you&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [December 25, 2015, 1:27am UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/5 "2015-12-25T01:27:28Z")

</div>

Greetings&nbsp;Steve,&nbsp;  
  
  
  
Sorry&nbsp;for&nbsp;the&nbsp;long&nbsp;delay,&nbsp;your&nbsp;problem&nbsp;could&nbsp;be&nbsp;solved&nbsp;by&nbsp;adding&nbsp;some&nbsp;codes&nbsp;in&nbsp;frmLegendProps.vb:&nbsp;  
  
  
  
Add&nbsp;&nbsp;  
  
&nbsp;&nbsp;_Legend.BackgroundMask.DrawingLevel&nbsp;=&nbsp;DrawingLevel.LabelLevel&nbsp;_  
  
right&nbsp;after&nbsp;the&nbsp;BackgroundMask&nbsp;is&nbsp;created.&nbsp;  
  
  
  
and&nbsp;add&nbsp;&nbsp;  
  
_&nbsp;&nbsp;oLegendItem.TextStyle.DrawingLevel&nbsp;=&nbsp;DrawingLevel.LabelLevel&nbsp;_  
  
_&nbsp;&nbsp;CType(oLegendItem.ImageStyle,&nbsp;AreaStyle).DrawingLevel&nbsp;=&nbsp;DrawingLevel.LabelLevel&nbsp;_  
  
in&nbsp;the&nbsp;foreach&nbsp;block&nbsp;from&nbsp;line&nbsp;78.&nbsp;  
  
  
  
This&nbsp;is&nbsp;because&nbsp;the&nbsp;labels&nbsp;in&nbsp;MapPrinterLayer&nbsp;always&nbsp;have&nbsp;the&nbsp;highest&nbsp;drawing&nbsp;level&nbsp;when&nbsp;printing,&nbsp;so&nbsp;it&nbsp;could&nbsp;be&nbsp;on&nbsp;top&nbsp;of&nbsp;the&nbsp;LegendPrinterLayer,&nbsp;but&nbsp;the&nbsp;reason&nbsp;that&nbsp;this&nbsp;problem&nbsp;did&nbsp;not&nbsp;happen&nbsp;"on&nbsp;the&nbsp;screen"&nbsp;because&nbsp;the&nbsp;MapPrinterLayer&nbsp;is&nbsp;drawn&nbsp;as&nbsp;raster&nbsp;image&nbsp;at&nbsp;that&nbsp;time.&nbsp;So&nbsp;the&nbsp;best&nbsp;solution&nbsp;is&nbsp;to&nbsp;upgrade&nbsp;the&nbsp;drawing&nbsp;level&nbsp;of&nbsp;LegendPrinterLayer,&nbsp;hope&nbsp;it&nbsp;helps.&nbsp;  
  
  
  
  
  
Thanks,&nbsp;  
  
Edgar

---

<div class="post-metadata">

**Author:** ![Steven1](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/steven1/32/18983_2.png) [@Steven1](https://community.thinkgeo.com/u/Steven1)\
**Post date:** [December 28, 2015, 12:39pm UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/6 "2015-12-28T12:39:51Z")

</div>

Edgar&nbsp;&&nbsp;everyone,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;reply!&nbsp;That&nbsp;fixed&nbsp;it!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Steve

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [December 28, 2015, 11:25pm UTC](https://community.thinkgeo.com/t/labels-show-through-legendprinterlayer/2635/7 "2015-12-28T23:25:07Z")

</div>

Hi&nbsp;Steve,&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;are&nbsp;glad&nbsp;to&nbsp;hear&nbsp;that&nbsp;fixed.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
