<?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 Display CIM symbol JSON in .NET ComboBox in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008282#M5856</link>
    <description>&lt;P&gt;Is there a way to display CIMSymbol, or the raw JSON, as an image in a .NET ComboBox? Or is there a way to export that JSON to a PNG or other image file?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2020 21:46:16 GMT</pubDate>
    <dc:creator>Douglas_DMeredith</dc:creator>
    <dc:date>2020-12-09T21:46:16Z</dc:date>
    <item>
      <title>Display CIM symbol JSON in .NET ComboBox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008282#M5856</link>
      <description>&lt;P&gt;Is there a way to display CIMSymbol, or the raw JSON, as an image in a .NET ComboBox? Or is there a way to export that JSON to a PNG or other image file?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 21:46:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008282#M5856</guid>
      <dc:creator>Douglas_DMeredith</dc:creator>
      <dc:date>2020-12-09T21:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Display CIM symbol JSON in .NET ComboBox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008345#M5858</link>
      <description>&lt;P&gt;Hi Douglas,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The upcoming 2.7 release has a symbol picker control as part of the SDK.&amp;nbsp; &amp;nbsp;The symbol picker displays a 'preview' image of the symbol in a listbox (just like Pro does).&amp;nbsp; &amp;nbsp;Regarding your question: you have a CIMSymbol and want to either display a 'preview image' for that symbol or extract the JSON to display the JSON string?&amp;nbsp; We have a sample here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/CustomSymbolPicker" target="_blank"&gt;arcgis-pro-sdk-community-samples/Map-Authoring/CustomSymbolPicker at master · Esri/arcgis-pro-sdk-community-samples (github.com)&lt;/A&gt;&amp;nbsp;that might provide some inside, but if you can describe your desired workflow in more detail i can probably guide you in the right direction.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 00:48:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008345#M5858</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-12-10T00:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Display CIM symbol JSON in .NET ComboBox</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008693#M5861</link>
      <description>&lt;P&gt;That sample helped a lot. SymbolStyleItem has the magic sauce I was looking for. My CIM symbol JSON is kept in a table. Walking the table, I now do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;CF cf = new CF();
cf.key = row["key"].ToString();
cf.symbol = row["symbol"].ToString();
//Wrap the symbol JSON in CIMSymbolReference, so we can use that class to 
//deserialize it.
cf.symbol = cf.symbol.Insert(0, "{\"type\": \"CIMSymbolReference\", \"symbol\": ");
cf.symbol = cf.symbol.Insert(cf.symbol.Length, "}");

//Create the preview image used in the ComboBox
SymbolStyleItem sSI = new SymbolStyleItem() {
	Symbol = CIMSymbolReference.FromJson(cf.symbol).Symbol,
	PatchWidth = 16,
	PatchHeight = 16
};
cf.preview = sSI.PreviewImage;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the xaml for the ComboBox now looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;ComboBox 
		x:Name="ContactsAndFaultsComboBox" 
		IsTextSearchEnabled="True"
		TextSearch.TextPath="key"
		ItemsSource="{Binding Path=(ui:DataHelper.CFs)}" 
		SelectedItem ="{Binding SelectedCF}" 
		Margin="0,0,0,5"  
		IsReadOnly="False" 
		IsEditable="True"  
		HorizontalAlignment="Left" 
		Height="25"  
		VerticalAlignment="Top" 
		Width="200"&amp;gt;
	&amp;lt;ComboBox.ItemTemplate&amp;gt;
		&amp;lt;DataTemplate&amp;gt;
			&amp;lt;StackPanel Orientation="Horizontal"&amp;gt;
				&amp;lt;Image Source="{Binding preview}"  Margin="0,2,5,2" /&amp;gt;
				&amp;lt;TextBlock Text="{Binding key}" /&amp;gt;
			&amp;lt;/StackPanel&amp;gt;
		&amp;lt;/DataTemplate&amp;gt;
	&amp;lt;/ComboBox.ItemTemplate&amp;gt;
&amp;lt;/ComboBox&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks, Wolf!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 21:36:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/display-cim-symbol-json-in-net-combobox/m-p/1008693#M5861</guid>
      <dc:creator>Douglas_DMeredith</dc:creator>
      <dc:date>2020-12-10T21:36:32Z</dc:date>
    </item>
  </channel>
</rss>

