Hello all,
I have a .stylx file, where are all symbols are stored. I need these symbols as pictures, for example as .png or .svg file. Is there an option to iterate over all symbols and save them as a picture in a special path?
Thanks for helping
Hi there!
You can not get all symbols in a .stylx file in one call. .stylx is a collection of symbols grouped by categories and have keys. Symbol are searched based on categories or keys. You can follow the workflow listed below to get images for symbols in a stylx.
```//Open stylx file SymbolStyle symbolstyle = await SymbolStyle.OpenAsync(@PathToStylx); // Get all categories and keys in the stylx.SymbolStyleSearchParameters searchParams = await symbolstyle .GetDefaultSearchParametersAsync(); // capture keys in a listvar keys_list = searchParams.Keys.ToList(); foreach (var key_item in keys_list){//for each key get the symbolvar sym = await symbolstyle .GetSymbolAsync(keys: new string[] { key_item }); //generate swatch for the symbolvar symbol_swatch = await sym.CreateSwatchAsync(); //create a bitmap that can then be saved locally.var bitmap_image = await symbol_swatch.ToImageSourceAsync(); .... // add code to save image locally}I also noticed you also posted same question on ArcGIS Maps SDK for Unityhttps://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/display-symbols-from-stylx-file/m-p/1197803#M64The ArcGIS Maps SDKs for Unity is different from ArcGIS Runtime SDK, they are two completely distinct SDKs. I was wondering if it just a mix up. If not, can you please explain how this question is related your game engine workflow.
Hello PreetiMaske,
thanks for your answer.
I explained why I try a mix up of unity 3d and arcgis .net: Display symbols from stylx file - Esri Community
Thanks for your help
I have another question.
I can't execute the line var bitmap_image = await symbol_swatch.ToImageSourceAsync(); because I can't find the method ToImageSourceAsync(); and I don't find this Method in the definition and documentation of the RuntimeImage:
Class RuntimeImage (arcgis.com)
Do you know what I have to do?
Hey Luis!
That's an extension method in Esri.ArcGISRuntime.UI. If you add the following "using" statement to the top of your code file, you should see it.
using Esri.ArcGISRuntime.UI;
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.