<?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: Adding FrameBox Content to a Datatable as an image. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418608#M66762</link>
    <description>&lt;P&gt;You might, or might not, want to resize it (&amp;lt;&amp;lt;scale below) because it will be scaled to fit later. If you don't resize, the original resolution is available if you want it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$sample_data/big class.jmp");
r = dt&amp;lt;&amp;lt;Graph Builder(
    Size( 518, 448 ),
    Show Control Panel( 0 ),
    Variables( X( :weight ), Y( :height ) ),
    Elements( Points( X, Y, Legend( 12 ) ), Smoother( X, Y, Legend( 13 ) ) )
);
myImage = ((r&amp;lt;&amp;lt;report)[FrameBox(1)])&amp;lt;&amp;lt;getpicture;
myImage&amp;lt;&amp;lt;scale(.25);

dtPics = New Table( "pics",
    Add Rows( 1 ),
    Set Cell Height( 100 ),
    New Column( "graphs", Expression, "None", Set Display Width( 150 ) )
);

dtPics:graphs[1] = myImage;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the example, 'r' is the scriptable report object, not the displaybox tree, You can ask the object for the tree with either r&amp;lt;&amp;lt;report or report(r). Navigating down the tree to Framebox(1) using subscripting finds the first framebox; there are no axes. If you want axes, pick a box higher in the tree that includes them. ShowTreeStructure can be really helpful.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The captured picture is just the framebox." style="width: 700px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35869i0A81266900362721/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="The captured picture is just the framebox." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The captured picture is just the framebox.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Edit: still asleep. You had the variable names correct; I should have used 'obj' rather than 'r' because 'r' should be for the report surface which is the display box tree.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 10:55:10 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2021-09-16T10:55:10Z</dc:date>
    <item>
      <title>Adding FrameBox Content to a Datatable as an image.</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418598#M66760</link>
      <description>&lt;P&gt;How do I take the output from Graphbuilder,&amp;nbsp; grab the main FRAMEBOX as an image, resize it and add it to a datatable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I make my output using Graph builder and then run the following.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj = GB &amp;lt;&amp;lt; Get Scriptable Object;
r= obj &amp;lt;&amp;lt; Report;
myImage = r[FrameBox(1)];
myImage &amp;lt;&amp;lt; setSize(100, 100);
DT:GFA[1] = myImage;&amp;nbsp;&amp;nbsp;//Row&amp;nbsp;1&amp;nbsp;of&amp;nbsp;column&amp;nbsp;'GFA' (Expression Column)&amp;nbsp;in&amp;nbsp;a&amp;nbsp;Table&amp;nbsp;called&amp;nbsp;'DT'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I think my issues is the 'image' returned is not an actual image but rather a display box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Troy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:56:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418598#M66760</guid>
      <dc:creator>thickey</dc:creator>
      <dc:date>2023-06-09T19:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding FrameBox Content to a Datatable as an image.</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418608#M66762</link>
      <description>&lt;P&gt;You might, or might not, want to resize it (&amp;lt;&amp;lt;scale below) because it will be scaled to fit later. If you don't resize, the original resolution is available if you want it.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$sample_data/big class.jmp");
r = dt&amp;lt;&amp;lt;Graph Builder(
    Size( 518, 448 ),
    Show Control Panel( 0 ),
    Variables( X( :weight ), Y( :height ) ),
    Elements( Points( X, Y, Legend( 12 ) ), Smoother( X, Y, Legend( 13 ) ) )
);
myImage = ((r&amp;lt;&amp;lt;report)[FrameBox(1)])&amp;lt;&amp;lt;getpicture;
myImage&amp;lt;&amp;lt;scale(.25);

dtPics = New Table( "pics",
    Add Rows( 1 ),
    Set Cell Height( 100 ),
    New Column( "graphs", Expression, "None", Set Display Width( 150 ) )
);

dtPics:graphs[1] = myImage;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the example, 'r' is the scriptable report object, not the displaybox tree, You can ask the object for the tree with either r&amp;lt;&amp;lt;report or report(r). Navigating down the tree to Framebox(1) using subscripting finds the first framebox; there are no axes. If you want axes, pick a box higher in the tree that includes them. ShowTreeStructure can be really helpful.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The captured picture is just the framebox." style="width: 700px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35869i0A81266900362721/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="The captured picture is just the framebox." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The captured picture is just the framebox.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Edit: still asleep. You had the variable names correct; I should have used 'obj' rather than 'r' because 'r' should be for the report surface which is the display box tree.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 10:55:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418608#M66762</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-09-16T10:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding FrameBox Content to a Datatable as an image.</title>
      <link>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418677#M66769</link>
      <description>&lt;P&gt;Thanks Craig. I've recently started to pull all my images into tables rather than working with external images from a directory. Makes for much easier application development.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for putting together a full working solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Troy&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 13:56:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Adding-FrameBox-Content-to-a-Datatable-as-an-image/m-p/418677#M66769</guid>
      <dc:creator>thickey</dc:creator>
      <dc:date>2021-09-16T13:56:13Z</dc:date>
    </item>
  </channel>
</rss>

