<?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: image jpg in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651212#M84202</link>
    <description>&lt;P&gt;Taking a similar approach to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;below is a simple example of script that displays an image based upon a data filter selection, but does not use a JMP platform such as Bivariate or Graph Builder.&amp;nbsp; It just simply displays an image.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1687520501584.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54114iC55AA57005975E81/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1687520501584.png" alt="txnelson_0-1687520501584.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1687520603106.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54116iF93F90A35EDECB65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1687520603106.png" alt="txnelson_1-1687520603106.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
path = "c:\users\???\pictures"; // set the path to your image directory 

// Filter out all non jpg files
files = Filter Each( {file}, Files In Directory( path ), Word( -1, file, "." ) == "jpg" );

// I create a dummy data table to use for an example
ob = {"A", "B", "C"};
dt = New Table( "Pictures", invisible,
	add rows( N Items( files ) ),
	New Column( "Obj", character, set each value( ob[Mod( Row(), 3 ) + 1] ) ),
	New Column( "type", nominal, set each value( Col Cumulative Sum( 1, :obj ) ) ),
	New Column( "ImagePath", character, set each value( files[Row()] ) )
);
:ImagePath &amp;lt;&amp;lt; hide;

// Here is the working code that can be used against a data table that matches
// the example data table created above
// It uses a Make Row State Handler to handle the changing of images when
// the data filter values change
nw = New Window( "Example",
	hlb = H List Box(
		dt &amp;lt;&amp;lt; Data Filter(
			Location( {928, 247} ),
			Mode( Include( 1 ) ),
			Add Filter( columns( :Obj, :type ), Display( :type, N Items( 8 ) ) )
		),
		pb = Graph Box( Frame Size( 600, 600 ) )
	)
);
pb( report )[axisbox( 2 )] &amp;lt;&amp;lt; delete;
pb( report )[axisbox( 1 )] &amp;lt;&amp;lt; delete;

theFunction = Function( {a},
	If( N Rows( dt &amp;lt;&amp;lt; get selected rows ) == 1,
		Try( pb &amp;lt;&amp;lt; delete );
		hlb &amp;lt;&amp;lt; append( pb = Picture Box( Open( path || "\" || dt:ImagePath[(dt &amp;lt;&amp;lt; get selected rows)[1]], jpg ) ) );
		pb &amp;lt;&amp;lt; set height( 600 );
		pb &amp;lt;&amp;lt; set width( 600 );
	,
		Try( pb &amp;lt;&amp;lt; delete );
		hlb &amp;lt;&amp;lt; append( pb = Graph Box( Frame Size( 600, 600 ) ) );
		pb( report )[axisbox( 2 )] &amp;lt;&amp;lt; delete;
		pb( report )[axisbox( 1 )] &amp;lt;&amp;lt; delete;
	)
);
rs = dt &amp;lt;&amp;lt; make row state handler( theFunction );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 11:43:57 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-06-23T11:43:57Z</dc:date>
    <item>
      <title>image jpg</title>
      <link>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651046#M84186</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Bonjour à tous,&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;J’ai une question par rapport aux images jpg, je ne trouve pas de documentation sur JMP à ce sujet.&lt;/DIV&gt;&lt;DIV&gt;Dans mon cas, je dispose d’un dossier contenant environ 3000 images sous le format «&amp;nbsp;jpg&amp;nbsp;».&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;J’aimerais pouvoir afficher dans le constructeur de graphiques ces images au format «&amp;nbsp;jpg&amp;nbsp;» en fonction de la sélection des filtres de données locales.&lt;BR /&gt;&lt;BR /&gt;Par exemple :&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hcarr01_1-1687505622793.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54092i9145153644B2A37F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hcarr01_1-1687505622793.png" alt="hcarr01_1-1687505622793.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;SPAN&gt;Ici, il faudrait que s’affiche l’image suivante : obj «&amp;nbsp;B&amp;nbsp;» et type «&amp;nbsp;2&amp;nbsp;».&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cette image se nomme comme ceci dans mon dossier : " B_2.jpg " .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Merci pour votre aide !&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jun 2023 07:39:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651046#M84186</guid>
      <dc:creator>hcarr01</dc:creator>
      <dc:date>2023-06-23T07:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: image jpg</title>
      <link>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651136#M84190</link>
      <description>&lt;P&gt;I think this is close to what you are asking for and should get you started:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// https://community.jmp.com/t5/Discussions/Drawing-other-shapes-in-graph-builder/m-p/368186#M61806

NamesDefaultToHere(1);

// Open a table and do Bivariate
dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt &amp;lt;&amp;lt; Bivariate(X(:height), Y(:weight));

// Add a local data filter (:sex plays the role of floor . . . )
df = biv &amp;lt;&amp;lt; Local Data Filter( Add Filter( columns( :sex ) ));

// Get the title of the window
win = (biv &amp;lt;&amp;lt; Report) &amp;lt;&amp;lt; GetWindowTitle;

// Define a function that will update the background image on the Bivariate plot
f = Function( {a},
		// Infer what value of :sex is currenly selected in the data filter
		levRows = df &amp;lt;&amp;lt; getFilteredRows;
		lev = Column(dt, "sex")[levRows];
		lev = lev[1];
		Speak(lev);
		// (Try to) remove an image that might already be there
		Try(
			imgSeg = Window(win)[FrameBox(2)] &amp;lt;&amp;lt; FindSeg( PictSeg( 1 ) );
			imgSeg &amp;lt;&amp;lt; Remove;
			);
		// Add the 'corresponding' image
		if(
			lev == "M",
				Window(win)[FrameBox(2)] &amp;lt;&amp;lt; Add Image(Open("$SAMPLE_IMAGES/tile.jpg"), FillGraph),
			lev == "F",
				Window(win)[FrameBox(2)] &amp;lt;&amp;lt; Add Image(Open("$SAMPLE_IMAGES/progress.gif"), FillGraph)
			);
		);

// Add a handler to the data filter so that when the user makes a selection the function 'f' is called
rs = df &amp;lt;&amp;lt; Make Filter Change Handler( f );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jun 2023 09:47:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651136#M84190</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2023-06-23T09:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: image jpg</title>
      <link>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651212#M84202</link>
      <description>&lt;P&gt;Taking a similar approach to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;below is a simple example of script that displays an image based upon a data filter selection, but does not use a JMP platform such as Bivariate or Graph Builder.&amp;nbsp; It just simply displays an image.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1687520501584.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54114iC55AA57005975E81/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1687520501584.png" alt="txnelson_0-1687520501584.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1687520603106.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54116iF93F90A35EDECB65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1687520603106.png" alt="txnelson_1-1687520603106.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
path = "c:\users\???\pictures"; // set the path to your image directory 

// Filter out all non jpg files
files = Filter Each( {file}, Files In Directory( path ), Word( -1, file, "." ) == "jpg" );

// I create a dummy data table to use for an example
ob = {"A", "B", "C"};
dt = New Table( "Pictures", invisible,
	add rows( N Items( files ) ),
	New Column( "Obj", character, set each value( ob[Mod( Row(), 3 ) + 1] ) ),
	New Column( "type", nominal, set each value( Col Cumulative Sum( 1, :obj ) ) ),
	New Column( "ImagePath", character, set each value( files[Row()] ) )
);
:ImagePath &amp;lt;&amp;lt; hide;

// Here is the working code that can be used against a data table that matches
// the example data table created above
// It uses a Make Row State Handler to handle the changing of images when
// the data filter values change
nw = New Window( "Example",
	hlb = H List Box(
		dt &amp;lt;&amp;lt; Data Filter(
			Location( {928, 247} ),
			Mode( Include( 1 ) ),
			Add Filter( columns( :Obj, :type ), Display( :type, N Items( 8 ) ) )
		),
		pb = Graph Box( Frame Size( 600, 600 ) )
	)
);
pb( report )[axisbox( 2 )] &amp;lt;&amp;lt; delete;
pb( report )[axisbox( 1 )] &amp;lt;&amp;lt; delete;

theFunction = Function( {a},
	If( N Rows( dt &amp;lt;&amp;lt; get selected rows ) == 1,
		Try( pb &amp;lt;&amp;lt; delete );
		hlb &amp;lt;&amp;lt; append( pb = Picture Box( Open( path || "\" || dt:ImagePath[(dt &amp;lt;&amp;lt; get selected rows)[1]], jpg ) ) );
		pb &amp;lt;&amp;lt; set height( 600 );
		pb &amp;lt;&amp;lt; set width( 600 );
	,
		Try( pb &amp;lt;&amp;lt; delete );
		hlb &amp;lt;&amp;lt; append( pb = Graph Box( Frame Size( 600, 600 ) ) );
		pb( report )[axisbox( 2 )] &amp;lt;&amp;lt; delete;
		pb( report )[axisbox( 1 )] &amp;lt;&amp;lt; delete;
	)
);
rs = dt &amp;lt;&amp;lt; make row state handler( theFunction );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 11:43:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/image-jpg/m-p/651212#M84202</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-23T11:43:57Z</dc:date>
    </item>
  </channel>
</rss>

