Hi, I use PictureFillSymbol Class Constructors PictureFillSymbol(Uri) \ PictureFillSymbol(Runtime) or PictureFillSymbol.CreateAsync(Stream imageStream) to create a PictureFillSymbol then use it to create a Graphic and add it to a GraphicOverlay, but the Graphic doesn't show, below is my codes
<SPAN class="comment token">// Get current assembly that contains the image</SPAN>
<SPAN class="keyword token">var</SPAN> currentAssembly <SPAN class="operator token">=</SPAN> Assembly<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetExecutingAssembly</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Get image as a stream from the resources</SPAN>
<SPAN class="comment token">// Picture is defined as EmbeddedResource and DoNotCopy</SPAN>
<SPAN class="keyword token">var</SPAN> resourceStream <SPAN class="operator token">=</SPAN> currentAssembly<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetManifestResourceStream</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="string token">"ArcGISRuntime.WPF.Resources.PictureMarkerSymbols.pin_star_blue.png"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> runtimeimage <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> RuntimeImage<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FromStreamAsync</SPAN><SPAN class="punctuation token">(</SPAN>resourceStream<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Create new symbol using asynchronous factory method from stream</SPAN>
PictureFillSymbol pinSymbol <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">PictureFillSymbol</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"pack://application:,,,/ArcGISRuntime.WPF.Samples.CSharp;component/Resources/PictureMarkerSymbols/pin_star_blue.png"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// (1) PictureFillSymbol pinSymbol = new PictureFillSymbol(runtimeimage);</SPAN>
<SPAN class="comment token">// (2) PictureFillSymbol pinSymbol =await PictureFillSymbol.CreateAsync(resourceStream);</SPAN>
<SPAN class="comment token">// Create location for the pint</SPAN>
MapPoint pinPoint <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">MapPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">226773</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">6550477</SPAN><SPAN class="punctuation token">,</SPAN> SpatialReferences<SPAN class="punctuation token">.</SPAN>WebMercator<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Create graphic with the location and symbol</SPAN>
Graphic pinGraphic <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Graphic</SPAN><SPAN class="punctuation token">(</SPAN>pinPoint<SPAN class="punctuation token">,</SPAN> pinSymbol<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Add graphic to the graphics overlay</SPAN>
overlay<SPAN class="punctuation token">.</SPAN>Graphics<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>pinGraphic<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MyMapView<SPAN class="punctuation token">.</SPAN>GraphicsOverlays<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>overlay<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>