Thursday, September 17, 2009 1:45 PM -
ArcGIS-Explorer-Team
Tip for add-in developers: How to bundle files in an EAZ file
Question: I am working on an add-in that will include several images that will be displayed as image overlays when the user views certain layers. What is the best way to include these images with my .eaz file so they can be accessed at runtime?
Answer: The correct way to bundle images, XML files, or whatever you need in your add-in is to include them in your Visual Studio add-in project using the Build Action of "Content." At runtime ArcGIS Explorer unzips the .eaz file into a temporary cache folder. In your code you can simply reference the images (or other files) as follows:
string executingAssemblyFqPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Image resource = Image.FromFile(Path.Combine(executingAssemblyFqPath,”aImage.jpg”));