Select to view content in your preferred language

How to customize the icon of a custom module in ArcGIS Pro SDK

1500
1
Jump to solution
05-11-2020 05:22 AM
Amadeus111
Frequent Contributor

I created a customized ArcGIS Pro module and everything works fine but I also would like to create a customized icon for the module. 

I found this resource but it does not work for me

ProGuide Content and Image Resources · Esri/arcgis-pro-sdk Wiki · GitHub 

using System.Windows.Media.Imaging;
using System.IO.Compression; //Image is defined as AddinContent.//AddinContent is ESRI custom build action. Cannot use without Addin
BitmapImage forAddinContent = new BitmapImage();
string id = "{49545510-2f4a-4e9c-bc12-3ea79a330fa0}";//From your module
using (ZipArchive zip = ZipFile.OpenRead(
   @"C:\Users\my_username\Documents\ArcGIS\AddIns\ArcGISPro\" + id +       
   @"\AddinContent.esriAddInX")) { 	
   ZipArchiveEntry zipEntry = zip.GetEntry("Images\AddInDesktop32.png"); 	
   MemoryStream ms = new MemoryStream(); 	
   using (Stream stmZip = zipEntry.Open())
    { stmZip.CopyTo(ms);} 	 
      forAddinContent.BeginInit(); 	
      forAddinContent.StreamSource = ms; 	
       forAddinContent.EndInit(); }

I get zipEntry = null error

Is there way to customize a module's icon?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
Amadeus111
Frequent Contributor

It was easier than I thought. I just needed to read the document more carefully. When I set the build action to "AddinContent"  for the image and use the relative path for the image in Config.daml problem solved. 

here is more info about build actions Build actions for files - Visual Studio | Microsoft Docs 

View solution in original post

0 Kudos
1 Reply
Amadeus111
Frequent Contributor

It was easier than I thought. I just needed to read the document more carefully. When I set the build action to "AddinContent"  for the image and use the relative path for the image in Config.daml problem solved. 

here is more info about build actions Build actions for files - Visual Studio | Microsoft Docs 

0 Kudos