I am struggling with ESRI's Picture / IPicture Java documentation for ArcObjects 10.4.
I just need to grab the image file from my project's source (src) folder, and cast that as a Picture. Here's what I've tried:
File pictureFile = new File("myImage.bmp"); Picture pictureDisp = (Picture) pictureFile; // FAIL: java.io.File cannot be cast to com.esri.arcgis.support.ms.stdole.Picture
Image image = ImageIO.read(getClass().getResource("myImage.bmp")); Picture pictureDisp = (Picture) image; // FAIL: java.awt.image.BufferedImage cannot be cast to com.esri.arcgis.support.ms.stdole.Picture
I've tried the above scenarios with IPicture as well. I have no idea by what process on can set the Picture (or IPicture) in ArcObjects Java.
I can't use a file path, this project will be deployed as an add-in, and not all users will have access to the same file paths. I need the file embedded in my program. I just want my image file to be accessible via Picture or IPicture.
I've also tried creating via BmpPictureElement, with zero success.