<?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 add symbol image to arcScene using local .png or .img file? in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1021940#M2300</link>
    <description>&lt;P&gt;How to add symbol image to arcScene using local .png or .img file?&lt;/P&gt;&lt;P&gt;I used this code but it doesnt work:&lt;/P&gt;&lt;P&gt;GraphicsOverlay graphicsOverlay = new GraphicsOverlay();&lt;BR /&gt;sceneView.getGraphicsOverlays().add(graphicsOverlay);&lt;BR /&gt;&lt;BR /&gt;// An image file on the hard drive.&lt;BR /&gt;File file = new File("C:\\Users\\user\\Documents\\IMG1.jpg");&lt;BR /&gt;&lt;BR /&gt;String localUri = file.toURI().toString();&lt;BR /&gt;&lt;BR /&gt;PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol(localUri);&lt;BR /&gt;markerSymbol.setHeight(100);&lt;BR /&gt;markerSymbol.setWidth(100);&lt;BR /&gt;&lt;BR /&gt;markerSymbol.loadAsync();&lt;BR /&gt;com.esri.arcgisruntime.geometry.Point symbolPoint = new com.esri.arcgisruntime.geometry.Point(20, 20, SpatialReferences.getWgs84());&lt;BR /&gt;Graphic symbolGraphic = new Graphic(symbolPoint, markerSymbol);&lt;BR /&gt;markerSymbol.addDoneLoadingListener(() -&amp;gt; graphicsOverlay.getGraphics().add(symbolGraphic));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jan 2021 17:57:06 GMT</pubDate>
    <dc:creator>VanyaIvanov</dc:creator>
    <dc:date>2021-01-31T17:57:06Z</dc:date>
    <item>
      <title>How to add symbol image to arcScene using local .png or .img file?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1021940#M2300</link>
      <description>&lt;P&gt;How to add symbol image to arcScene using local .png or .img file?&lt;/P&gt;&lt;P&gt;I used this code but it doesnt work:&lt;/P&gt;&lt;P&gt;GraphicsOverlay graphicsOverlay = new GraphicsOverlay();&lt;BR /&gt;sceneView.getGraphicsOverlays().add(graphicsOverlay);&lt;BR /&gt;&lt;BR /&gt;// An image file on the hard drive.&lt;BR /&gt;File file = new File("C:\\Users\\user\\Documents\\IMG1.jpg");&lt;BR /&gt;&lt;BR /&gt;String localUri = file.toURI().toString();&lt;BR /&gt;&lt;BR /&gt;PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol(localUri);&lt;BR /&gt;markerSymbol.setHeight(100);&lt;BR /&gt;markerSymbol.setWidth(100);&lt;BR /&gt;&lt;BR /&gt;markerSymbol.loadAsync();&lt;BR /&gt;com.esri.arcgisruntime.geometry.Point symbolPoint = new com.esri.arcgisruntime.geometry.Point(20, 20, SpatialReferences.getWgs84());&lt;BR /&gt;Graphic symbolGraphic = new Graphic(symbolPoint, markerSymbol);&lt;BR /&gt;markerSymbol.addDoneLoadingListener(() -&amp;gt; graphicsOverlay.getGraphics().add(symbolGraphic));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 17:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1021940#M2300</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2021-01-31T17:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add symbol image to arcScene using local .png or .img file?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1021942#M2301</link>
      <description>&lt;P&gt;If you are working with a file on the local OS, you don't need a full URI format, you can just use the file on its own.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tried this out with the following code:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;    GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
    mapView.getGraphicsOverlays().add(graphicsOverlay);

    // An image file on the hard drive.
    PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol("./FireStation.png");
    markerSymbol.setHeight(100);
    markerSymbol.setWidth(100);

    markerSymbol.loadAsync();
    markerSymbol.addDoneLoadingListener(() -&amp;gt; {
      System.out.println("loaded status " + markerSymbol.getLoadStatus());

      if (markerSymbol.getLoadStatus() == LoadStatus.LOADED) {
        // use the symbol
        Point point = new Point(0,0);

        Graphic graphic = new Graphic(point,markerSymbol);
        graphicsOverlay.getGraphics().add(graphic);

      } else {
        // error state as it didn't load
        System.out.println("Failed to load: " + markerSymbol.getLoadError().getCause());
      }
    });&lt;/LI-CODE&gt;&lt;P&gt;Does this work for you?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2021 19:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1021942#M2301</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-01-31T19:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add symbol image to arcScene using local .png or .img file?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1022473#M2302</link>
      <description>&lt;P&gt;Thank you! It works.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 06:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1022473#M2302</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2021-02-02T06:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to add symbol image to arcScene using local .png or .img file?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1022488#M2303</link>
      <description>&lt;P&gt;An alternative solution would be to construct the symbol directly from a JavaFX image.&amp;nbsp; If you are already using the image elsewhere in your app for example, you could do this:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;    Image image = new Image("file:FireStation.png", 100, 100, false, false);
    PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol(image);&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 Feb 2021 10:22:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-add-symbol-image-to-arcscene-using-local/m-p/1022488#M2303</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-02-02T10:22:41Z</dc:date>
    </item>
  </channel>
</rss>

