ArcGISRuntime.WPF.Samples.RenderPictureMarkers.RenderPictureMarkers.CreatePictureMarkerSymbolFromResources C# (CSharp) Метод

CreatePictureMarkerSymbolFromResources() приватный Метод

private CreatePictureMarkerSymbolFromResources ( GraphicsOverlay overlay ) : System.Threading.Tasks.Task
overlay GraphicsOverlay
Результат System.Threading.Tasks.Task
        private async Task CreatePictureMarkerSymbolFromResources(GraphicsOverlay overlay)
        {
            // Get current assembly that contains the image
            var currentAssembly = Assembly.GetExecutingAssembly();

            // Get image as a stream from the resources
            // Picture is defined as EmbeddedResource and DoNotCopy
            var resourceStream = currentAssembly.GetManifestResourceStream(
                "ArcGISRuntime.WPF.Resources.PictureMarkerSymbols.pin_star_blue.png");

            // Create new symbol using asynchronous factory method from stream
            PictureMarkerSymbol pinSymbol = await PictureMarkerSymbol.CreateAsync(resourceStream);

            // Create location for the pint
            MapPoint pinPoint = new MapPoint(-226773, 6550477, SpatialReferences.WebMercator);

            // Create graphic with the location and symbol
            Graphic pinGraphic = new Graphic(pinPoint, pinSymbol);

            // Add graphic to the graphics overlay
            overlay.Graphics.Add(pinGraphic);
        }
    }