<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add an image to an existing data frame using Python? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309057#M24069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am really new to this coding thing, but my files are name.jpg.&amp;nbsp; How do I get the .jpg to attach to the picture name after name?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2013 19:20:12 GMT</pubDate>
    <dc:creator>MeganMiller4</dc:creator>
    <dc:date>2013-01-10T19:20:12Z</dc:date>
    <item>
      <title>How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309053#M24065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is the first time I am using Python on my own, and I have searched for this answer for a few hours with no luck. I am wanting to take a .JPG image and put it in an existing data frame. The image has to be in color, and needs to change with data driven pages.&amp;nbsp; Help would be greatly appreciated. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 19:53:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309053#M24065</guid>
      <dc:creator>MeganMiller4</dc:creator>
      <dc:date>2013-01-09T19:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309054#M24066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Megan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, make a Raster Layer from the JPEG, and then use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s300000025000000" rel="nofollow noopener noreferrer" target="_blank"&gt;AddLayer&lt;/A&gt;&lt;SPAN&gt; function to add the raster layer to the MXD.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

arcpy.MakeRasterLayer_management(r"C:\DATA\RASTER\JPG\barberspt.jpg", "BarbersPt")

mxd = arcpy.mapping.MapDocument(r"C:\Temp\Python\Harbour.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
addLayer = arcpy.mapping.Layer("BarbersPt")
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
mxd.save()

del mxd&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:46:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309054#M24066</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T14:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309055#M24067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This helped with inserting the photo in color.&amp;nbsp; It kept putting the photo on the top most data frame, but I moved my data frame that needed the photo to the top and that is fixed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have ran a code to generate a list of names, but is there away to take the list generated from this code, and insert it &lt;/SPAN&gt;&lt;STRONG&gt;here&lt;/STRONG&gt;&lt;SPAN&gt;? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeRasterLayer_management(r"C:\ArcGISProjects\SamplePhotos\&lt;/SPAN&gt;&lt;STRONG&gt;BoraBoraTurtles.jpg&lt;/STRONG&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;&lt;STRONG&gt;BoraBoraTurtles&lt;/STRONG&gt;&lt;SPAN&gt;")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 14:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309055#M24067</guid>
      <dc:creator>MeganMiller4</dc:creator>
      <dc:date>2013-01-10T14:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309056#M24068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can specify the specific data frame you want to add the raster to by using it's name in the following line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;df = arcpy.mapping.ListDataFrames(mxd, "&amp;lt;data frame name&amp;gt;")[0]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To use the names in the list, you could do something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;for name in list: &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeRasterLayer_management(r"C:\ArcGISProjects\SamplePhotos" + "\\" + name, name)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 17:42:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309056#M24068</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-01-10T17:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309057#M24069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am really new to this coding thing, but my files are name.jpg.&amp;nbsp; How do I get the .jpg to attach to the picture name after name?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 19:20:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309057#M24069</guid>
      <dc:creator>MeganMiller4</dc:creator>
      <dc:date>2013-01-10T19:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309058#M24070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You would just need to add '+ ".jpg"' to the code.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for name in list:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeRasterLayer_management(r"C:\ArcGISProjects\SamplePhotos" + "\\" + name + ".jpg", name)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:46:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309058#M24070</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T14:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add an image to an existing data frame using Python?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309059#M24071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This helped thanks.&amp;nbsp; I thought I tried that but I am assuming I had a mistype somewhere.&amp;nbsp; Thanks for all of your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-an-image-to-an-existing-data-frame/m-p/309059#M24071</guid>
      <dc:creator>MeganMiller4</dc:creator>
      <dc:date>2013-01-11T15:25:50Z</dc:date>
    </item>
  </channel>
</rss>

