<?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 Re: About PictureFillSymbol in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449507#M10413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the agslib-3.0-2012-06-06.swc won't have the problem .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The agslib-3.2-2013-03-19.swc will have the problem .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Apr 2013 07:14:17 GMT</pubDate>
    <dc:creator>BinbinWang</dc:creator>
    <dc:date>2013-04-29T07:14:17Z</dc:date>
    <item>
      <title>About PictureFillSymbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449505#M10411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I using ArcGIS API for flex 3.2+flash builder 4.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to draw a Bitmap on a map. I used the PictureFillSymbol, but the polygon didn't been filled by the Bitmap, the polygon is empty. Can you help me? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My codes :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:s="library://ns.adobe.com/flex/spark"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:mx="library://ns.adobe.com/flex/mx"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:esri="http://www.esri.com/2008/ags"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pageTitle="Example #1"&amp;gt;
 &amp;lt;fx:Declarations&amp;gt;
&amp;nbsp; &amp;lt;esri:SimpleLineSymbol id = "sls" color="0xff0000"&amp;gt;
&amp;nbsp; &amp;lt;/esri:SimpleLineSymbol&amp;gt;
 &amp;lt;/fx:Declarations&amp;gt;
 &amp;lt;esri:Map id="map" clickRecenterEnabled="false" crosshairVisible="true" logoVisible="false" &amp;gt;
&amp;nbsp; &amp;lt;esri:ArcGISTiledMapServiceLayer
&amp;nbsp;&amp;nbsp; url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" /&amp;gt;
&amp;nbsp; 
&amp;nbsp; &amp;lt;esri:extent&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Extent id="esriMapExtent" xmin="10" ymin="39.5"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax="116.5" ymax="40.5"/&amp;gt;
&amp;nbsp; &amp;lt;/esri:extent&amp;gt;
 &amp;lt;/esri:Map&amp;gt;
 &amp;lt;mx:Button label="button" click="initApp()" x="121" y="96" fontSize="12"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width="209"/&amp;gt;
 &amp;lt;fx:Script&amp;gt;
&amp;nbsp; &amp;lt;![CDATA[
&amp;nbsp;&amp;nbsp; import com.esri.ags.Graphic;
&amp;nbsp;&amp;nbsp; import com.esri.ags.SpatialReference;
&amp;nbsp;&amp;nbsp; import com.esri.ags.geometry.Extent;
&amp;nbsp;&amp;nbsp; import com.esri.ags.geometry.MapPoint;
&amp;nbsp;&amp;nbsp; import com.esri.ags.geometry.Polygon;
&amp;nbsp;&amp;nbsp; import com.esri.ags.geometry.Polyline;
&amp;nbsp;&amp;nbsp; import com.esri.ags.layers.GraphicsLayer;
&amp;nbsp;&amp;nbsp; import com.esri.ags.symbols.PictureFillSymbol;
&amp;nbsp;&amp;nbsp; import com.esri.ags.symbols.SimpleFillSymbol;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; import flash.display.Bitmap;
&amp;nbsp;&amp;nbsp; import flash.display.BitmapData;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; import mx.controls.Alert;

&amp;nbsp;&amp;nbsp; public function initApp():void{
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var bmd:BitmapData = new BitmapData(30, 30, true,0x10ff0011);
&amp;nbsp;&amp;nbsp;&amp;nbsp; var bitmap:Bitmap =&amp;nbsp; new Bitmap(bmd,"auto",true);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphicsLayer:GraphicsLayer = new GraphicsLayer();
&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic:Graphic = new Graphic();
&amp;nbsp;&amp;nbsp;&amp;nbsp; var polygon:Polygon = new Polygon();

&amp;nbsp;&amp;nbsp;&amp;nbsp; var ring:Array = new Array();
&amp;nbsp;&amp;nbsp;&amp;nbsp; ring.push(new MapPoint(30,60));
&amp;nbsp;&amp;nbsp;&amp;nbsp; ring.push(new MapPoint(120,60));
&amp;nbsp;&amp;nbsp;&amp;nbsp; ring.push(new MapPoint(120,0));
&amp;nbsp;&amp;nbsp;&amp;nbsp; ring.push(new MapPoint(30,0));
&amp;nbsp;&amp;nbsp;&amp;nbsp; ring.push(new MapPoint(30,60));
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon.addRing(ring);
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon.spatialReference = map.spatialReference;
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.geometry = polygon;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var extent:Extent = polygon.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var resolution:Number = map.lods[map.level].resolution;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var width:Number = extent.width/resolution;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var height:Number = extent.height/resolution;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; var fill:PictureFillSymbol = new PictureFillSymbol();
&amp;nbsp;&amp;nbsp;&amp;nbsp; fill.source = bitmap; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; fill.outline=sls;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fill.width = width;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fill.height = height;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fill.xoffset = width/2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fill.yoffset = height/2;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //var fill:SimpleFillSymbol = new SimpleFillSymbol("solid",0xFF0000,0.5);

&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.symbol = fill;

&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer.add(graphic);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(graphicsLayer);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; ]]&amp;gt;
 &amp;lt;/fx:Script&amp;gt;
 
&amp;lt;/s:Application&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 12:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449505#M10411</guid>
      <dc:creator>BinbinWang</dc:creator>
      <dc:date>2013-04-28T12:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: About PictureFillSymbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449506#M10412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you have any ideas to draw a Bitmap on the map ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 05:55:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449506#M10412</guid>
      <dc:creator>BinbinWang</dc:creator>
      <dc:date>2013-04-29T05:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: About PictureFillSymbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449507#M10413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the agslib-3.0-2012-06-06.swc won't have the problem .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The agslib-3.2-2013-03-19.swc will have the problem .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 07:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449507#M10413</guid>
      <dc:creator>BinbinWang</dc:creator>
      <dc:date>2013-04-29T07:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: About PictureFillSymbol</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449508#M10414</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;There is actually a bug, thanks for reporting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a workaround in the meantime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Encode the BitmapData into a ByteArray, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var pngEncoder:PNGEncoder = new PNGEncoder();
var bmd:BitmapData = new BitmapData(30, 30, true,0x10ff0011);
var bytes:ByteArray = pngEncoder.encode(bmd);
var fill:PictureFillSymbol = new PictureFillSymbol();
fill.source = bytes;
fill.outline=sls;
fill.width = 30;
fill.height = 30;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:04:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/about-picturefillsymbol/m-p/449508#M10414</guid>
      <dc:creator>YannCabon</dc:creator>
      <dc:date>2021-12-11T20:04:01Z</dc:date>
    </item>
  </channel>
</rss>

