Save Image as Part of layout - How to do that using SDK ?

730
2
06-10-2020 11:51 AM
Sai_PhaneendraPoludasu2
New Contributor III

Hi,

When I imported a MXD with a layout to a ArcGIS Pro project, embedded pictures also are imported and the properties of picture element show no URL which is expected. When I paste a image directly into layout in Pro, it shows a temp file path and it stays the same once saved. I can see the image when I reopen the pro project although the temp file path is inaccessible?

In ArcObjects SDK, using SavePictureInDocument property we could save image as they were copied directly to document. How can we do that in ArcGIS ProSDK ?

0 Kudos
2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

If you look inside the project file (it's a zip format, so you can unzip it) you will be able to find your layout stored in form of a CIMLayout XML (mine is called layout.xml). You can also use the CIMViewer tool to inspect the CIMLayout without looking at the project file.  If you look through the CIMLayout and more specifically through the Graphic elements within the CIMLayout tag you will find that your image is included under the PictureURL tag as a base64 encoded jpeg.  That's why you see the image when you open your layout even so the original path from where the image was sourced is inaccessible.  When you further inspect the same Graphics tag you see the original source path stored under the SourceURL tag.  This SourceURL tag's content is what you see when you open up the properties page for the image.  

0 Kudos
Sai_PhaneendraPoludasu2
New Contributor III

Wolfgang Kaiser‌ Understood. I'll setup CIMViewer and explore more. After reading the above explanation, one follow up question is does every picture either inserted or pasted in the layout would be saved as base64 jpeg?

If not, Any idea on this part of the question ?

In ArcObjects SDK, using SavePictureInDocument property we could save image as they were copied directly to document. How can we do that in ArcGIS ProSDK ?

Thanks !

0 Kudos