<?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: Creating PictureFillSymbol using JSON - use pixels instead of points in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221935#M20596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vygintas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; True the assumption was just to demonstrate the math for the calculation. There is a lot of results out there on Google for using &lt;A href="https://www.google.com/search?q=javascript+get+device+dpi&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;channel=sb"&gt;JS to obtain the devices DPI&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2014 20:25:53 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2014-10-07T20:25:53Z</dc:date>
    <item>
      <title>Creating PictureFillSymbol using JSON - use pixels instead of points</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221932#M20593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've noticed that when PictureFillSymbol is created from a JSON object, width and height are defined in points. This is an issue because when I read PictureFillSymbol width and height properties after it has been created, they both return pixels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an excerpt from the API documentation (&lt;A href="http://https://developers.arcgis.com/javascript/jsapi/picturefillsymbol-amd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://https://developers.arcgis.com/javascript/jsapi/picturefillsymbol-amd.html&lt;/A&gt;) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #000000; font-size: 13.63636302948px; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Note that when specifying symbol width and height using JSON the values should be entered in points, the JavaScript API then converts the point values to pixels.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 13.63636302948px;"&gt;Sample code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="kwd" style="color: #000088;"&gt;&lt;SPAN class="kwd" style="color: #000088;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; symbol &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #000088;"&gt;new&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #000000;"&gt;PictureMarkerSymbol&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;({&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #999999;"&gt;"url"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #999999;"&gt;"graphics/redArrow2.png"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #999999;"&gt;"height"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #006666;"&gt;20&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #999999;"&gt;"width"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #006666;"&gt;20&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #999999;"&gt;"type"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #999999;"&gt;"esriPMS"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;});&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; font-size: 13.63636302948px;"&gt;Is there any way to avoid this conversion? Alternatively, is there functionality convert pixels back to points?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:48:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221932#M20593</guid>
      <dc:creator>VygintasCesnauskas</dc:creator>
      <dc:date>2021-12-11T10:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating PictureFillSymbol using JSON - use pixels instead of points</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221933#M20594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vygintas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Assuming the screen DPI is 96 this is the simple conversion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To convert point to pixel:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; pixels = point * 96 / 72&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 20:45:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221933#M20594</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-10-06T20:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating PictureFillSymbol using JSON - use pixels instead of points</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221934#M20595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately we can't assume that user is running 96 DPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now, as a workaround, I took out width and height attributes from PictureMarkerSymbol JSON and instead set them after the object is created using methods setWidth() and setHeight(). Those methods use pixels, so no conversion is necessary. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 20:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221934#M20595</guid>
      <dc:creator>VygintasCesnauskas</dc:creator>
      <dc:date>2014-10-07T20:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Creating PictureFillSymbol using JSON - use pixels instead of points</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221935#M20596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vygintas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; True the assumption was just to demonstrate the math for the calculation. There is a lot of results out there on Google for using &lt;A href="https://www.google.com/search?q=javascript+get+device+dpi&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;channel=sb"&gt;JS to obtain the devices DPI&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 20:25:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/creating-picturefillsymbol-using-json-use-pixels/m-p/221935#M20596</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-10-07T20:25:53Z</dc:date>
    </item>
  </channel>
</rss>

