<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to display PNG to container with transparent background ? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491386#M13235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to incorporate a PNG image to a container.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This image has a transparent background but when I add it to the container it becomes white. Any idea what can do such thing ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code is looking something like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IPageLayout pageLayout = ((MapServer)mapserver).getPageLayout();
IGraphicsContainer container = (IGraphicsContainer) pageLayout;

PngPictureElement pngPicElem = (PngPictureElement) this.currentRequestServerContext.createObject(PngPictureElement.getClsid());
pngPicElem.importPictureFromFile(imgResult.getURL());

container.addElement(pngPicElem, 0);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to manually set the background of my element but with no success :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IColor color = (IColor) (this.currentRequestServerContext.createObject(RgbColor.getClsid()));
color.setTransparency((byte) 0);
color.setRGB(0xFF0000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
SymbolBackground symbBg = (SymbolBackground) this.currentRequestServerContext.createObject(SymbolBackground.getClsid());
symbBg.setColor(color);
pngPicElem.setBackground(symbBg);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;N.B. I'm using Java ArcObjects SDK on ArcGIS Server 10&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Feb 2014 12:16:39 GMT</pubDate>
    <dc:creator>MathieuVILLEMONT1</dc:creator>
    <dc:date>2014-02-12T12:16:39Z</dc:date>
    <item>
      <title>How to display PNG to container with transparent background ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491386#M13235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to incorporate a PNG image to a container.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This image has a transparent background but when I add it to the container it becomes white. Any idea what can do such thing ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code is looking something like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IPageLayout pageLayout = ((MapServer)mapserver).getPageLayout();
IGraphicsContainer container = (IGraphicsContainer) pageLayout;

PngPictureElement pngPicElem = (PngPictureElement) this.currentRequestServerContext.createObject(PngPictureElement.getClsid());
pngPicElem.importPictureFromFile(imgResult.getURL());

container.addElement(pngPicElem, 0);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to manually set the background of my element but with no success :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
IColor color = (IColor) (this.currentRequestServerContext.createObject(RgbColor.getClsid()));
color.setTransparency((byte) 0);
color.setRGB(0xFF0000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
SymbolBackground symbBg = (SymbolBackground) this.currentRequestServerContext.createObject(SymbolBackground.getClsid());
symbBg.setColor(color);
pngPicElem.setBackground(symbBg);
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;N.B. I'm using Java ArcObjects SDK on ArcGIS Server 10&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 12:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491386#M13235</guid>
      <dc:creator>MathieuVILLEMONT1</dc:creator>
      <dc:date>2014-02-12T12:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to display PNG to container with transparent background ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491387#M13236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Transparency may not be supported, look &lt;/SPAN&gt;&lt;A href="http://support.esri.com/en/knowledgebase/techarticles/detail/34286"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 13:57:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491387#M13236</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-02-19T13:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to display PNG to container with transparent background ?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491388#M13237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Indeed &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 15:18:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-display-png-to-container-with-transparent/m-p/491388#M13237</guid>
      <dc:creator>MathieuVILLEMONT1</dc:creator>
      <dc:date>2014-03-12T15:18:29Z</dc:date>
    </item>
  </channel>
</rss>

