I've written a little java add-in button for ArcDesktop 10.4, in eclipse, which makes a new ArcMap layer with some points. (NOT Runtime) My goal is to assign a picture as the symbol for each of these points. I have success on my machine, but I can't figure out how to make my picture accessible to all future users.
Here's my class, part of larger program, which does work, but image currently only comes through from path on my own computer:
public class SymbologyChanger {
public SymbologyChanger(ArrayList<Point> pointsForTheLayer, IMap currentMap) throws AutomationException, IOException {
IGraphicsContainer graphContainer = (IGraphicsContainer) currentMap.getActiveGraphicsLayer();
for (int i = 0; i < pointsForTheLayer.size(); i++) {
Point point = (Point) pointsForTheLayer.get(i);
double symbolSize = 15;
IPictureMarkerSymbol picSym = new PictureMarkerSymbol();
picSym.setSize(symbolSize);
// http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriDisplay/esriIPictureType.htm
picSym.createMarkerSymbolFromFile(1, "C:\\Users\\userName\\eclipseWorkspace\\java_project\\images\\my_image.bmp");
IMarkerElement markerElement = new MarkerElement();
markerElement.setSymbol(picSym);
IElement element = (IElement) markerElement;
element.setGeometry(point);
graphContainer.addElement(element, 0);
}
}
}
So it's this particular line:
picSym.createMarkerSymbolFromFile(1, "C:\\Users\\userName\\eclipseWorkspace\\java_project\\images\\my_image.bmp");
which is my problem. I've placed the image in the project images folder, along with the button icon. The button icon totally works, but for the points symbol, I've tried:
picSym.createMarkerSymbolFromFile(1, "images\\my_image.bmp");
And this does not work.
Again, I get the image I want for the point symbol, but how to set the path correctly to share with others? I need the image to work as the point symbol with all machines, not just my own.
\\someserver\somefolder\my_image.bmp