<?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 Window that Scrolls Through Images in a Folder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Window-that-Scrolls-Through-Images-in-a-Folder/m-p/490857#M73286</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help with the scripting syntax. I am using JMP 16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the script to read through all the files in a subfolder and identify the files that has the jpg extension.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is display a Window, with a forward and backward button, that would allow the user to display the images. How would I go about creating that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;folder = char(Get Default Directory()) || "images/"; //subfolder is "images"
names = Files In Directory( folder );

dtpicnames = New Table( "Filenames of Images",
	New Column( "filename", character ),
	New Column( "inspection result", character ),
	New Column( "path", character )
);
dtpicnames &amp;lt;&amp;lt; move window(800, 0);

for( ii = 1, ii &amp;lt;= N Items(names), ii++,
	if( Ends With( names[ii], ".jpg"),
		dtpicnames &amp;lt;&amp;lt; Add Rows(1);
		dtpicnames:filename = names[ii];
		dtpicnames:path = folder || names[ii];
	);
);

img = new image(dtpicnames:path[1]);
	img &amp;lt;&amp;lt; scale(0.5);

w = New Window( "Image", pb = Picture Box( img ) );
w &amp;lt;&amp;lt; move window(0, 0);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 16:59:52 GMT</pubDate>
    <dc:creator>LaserGuy</dc:creator>
    <dc:date>2023-06-09T16:59:52Z</dc:date>
    <item>
      <title>Window that Scrolls Through Images in a Folder</title>
      <link>https://community.jmp.com/t5/Discussions/Window-that-Scrolls-Through-Images-in-a-Folder/m-p/490857#M73286</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help with the scripting syntax. I am using JMP 16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the script to read through all the files in a subfolder and identify the files that has the jpg extension.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is display a Window, with a forward and backward button, that would allow the user to display the images. How would I go about creating that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;folder = char(Get Default Directory()) || "images/"; //subfolder is "images"
names = Files In Directory( folder );

dtpicnames = New Table( "Filenames of Images",
	New Column( "filename", character ),
	New Column( "inspection result", character ),
	New Column( "path", character )
);
dtpicnames &amp;lt;&amp;lt; move window(800, 0);

for( ii = 1, ii &amp;lt;= N Items(names), ii++,
	if( Ends With( names[ii], ".jpg"),
		dtpicnames &amp;lt;&amp;lt; Add Rows(1);
		dtpicnames:filename = names[ii];
		dtpicnames:path = folder || names[ii];
	);
);

img = new image(dtpicnames:path[1]);
	img &amp;lt;&amp;lt; scale(0.5);

w = New Window( "Image", pb = Picture Box( img ) );
w &amp;lt;&amp;lt; move window(0, 0);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:59:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Window-that-Scrolls-Through-Images-in-a-Folder/m-p/490857#M73286</guid>
      <dc:creator>LaserGuy</dc:creator>
      <dc:date>2023-06-09T16:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Window that Scrolls Through Images in a Folder</title>
      <link>https://community.jmp.com/t5/Discussions/Window-that-Scrolls-Through-Images-in-a-Folder/m-p/491018#M73291</link>
      <description>&lt;P&gt;Here is a modification of your code that works on an image folder on my system&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

folder = char(Get Default Directory()) || "images/"; //subfolder is "images"

names = Files In Directory( folder );

dtpicnames = New Table( "Filenames of Images",
	New Column( "filename", character ),
	New Column( "inspection result", character ),
	New Column( "path", character )
);
dtpicnames &amp;lt;&amp;lt; move window( 800, 0 );

For( ii = 1, ii &amp;lt;= N Items( names ), ii++,
	If( Ends With( Uppercase( names[ii] ), ".JPG" ),
		dtpicnames &amp;lt;&amp;lt; Add Rows( 1 );
		dtpicnames:filename = names[ii];
		dtpicnames:path = folder || "\" || names[ii];
	)
);

theRow = 1;
img = New Image( dtpicnames:path[theRow] );
img &amp;lt;&amp;lt; scale( 0.1 );
	

w = New Window( "Image",
	V List Box(
		vlb = V List Box( pb = Picture Box( img ) ),
		H List Box(
			Button Box( "Up",
				If( theRow &amp;gt; 1,
					theRow --;
					pb &amp;lt;&amp;lt; delete;
					img = New Image( dtpicnames:path[theRow] );
					img &amp;lt;&amp;lt; scale( 0.1 );
					vlb &amp;lt;&amp;lt; append( pb = Picture Box( img ) )
				)
			),
			Button Box( "Down",
				If( theRow &amp;lt; N Rows( dtpicnames ) - 1,
					theRow ++;
					pb &amp;lt;&amp;lt; delete;
					img = New Image( dtpicnames:path[theRow] );
					img &amp;lt;&amp;lt; scale( 0.1 );
					vlb &amp;lt;&amp;lt; append( pb = Picture Box( img ) );
				)
			)
		)
	)
);
w &amp;lt;&amp;lt; move window( 0, 0 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2022 02:22:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Window-that-Scrolls-Through-Images-in-a-Folder/m-p/491018#M73291</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-05-24T02:22:35Z</dc:date>
    </item>
  </channel>
</rss>

