<?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 How to open an image file after clicking on Picture Box? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259800#M50980</link>
    <description>&lt;P&gt;Hello Everybody,&lt;/P&gt;&lt;P&gt;I am using picture boxes to display 4 images loaded from files. The size of images needs to be reduced for displaying purposes. However, I would like to open an original image file after clicking on the image displayed in the picture box. I would appreciate for hints how to do that.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();
New Window("Images",             
		H List Box(
		Panel Box("El 1",  //place for EL images
			EL1 = Picture Box(img1),				
		),
		Panel Box("El 2",
			EL2 = Picture Box(img2),
		),
		Panel Box("El 3",
			EL3 = Picture Box(img3),
		),
		Panel Box("El 4",
			EL4 = Picture Box(img4),
		),
);
//here images will be opened
//img1 = open("D:\image.tif", tif);
//img1 &amp;lt;&amp;lt; set size({image_w_new, image_h_new});
//EL1 &amp;lt;&amp;lt; set image (img1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Apr 2020 13:19:07 GMT</pubDate>
    <dc:creator>lukasz</dc:creator>
    <dc:date>2020-04-22T13:19:07Z</dc:date>
    <item>
      <title>How to open an image file after clicking on Picture Box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259800#M50980</link>
      <description>&lt;P&gt;Hello Everybody,&lt;/P&gt;&lt;P&gt;I am using picture boxes to display 4 images loaded from files. The size of images needs to be reduced for displaying purposes. However, I would like to open an original image file after clicking on the image displayed in the picture box. I would appreciate for hints how to do that.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();
New Window("Images",             
		H List Box(
		Panel Box("El 1",  //place for EL images
			EL1 = Picture Box(img1),				
		),
		Panel Box("El 2",
			EL2 = Picture Box(img2),
		),
		Panel Box("El 3",
			EL3 = Picture Box(img3),
		),
		Panel Box("El 4",
			EL4 = Picture Box(img4),
		),
);
//here images will be opened
//img1 = open("D:\image.tif", tif);
//img1 &amp;lt;&amp;lt; set size({image_w_new, image_h_new});
//EL1 &amp;lt;&amp;lt; set image (img1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Apr 2020 13:19:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259800#M50980</guid>
      <dc:creator>lukasz</dc:creator>
      <dc:date>2020-04-22T13:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to open an image file after clicking on Picture Box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259833#M50987</link>
      <description>&lt;P&gt;Could use a mousebox.&amp;nbsp; But understand that the mousebox will make you lose other mouse functionality for that object (context menus, selecting graphs, etc)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();

New Window("Images",             
	H List Box(
		mb = MouseBox(
			Panel Box("El 1",  //place for EL images
				EL1 = Picture Box(img1),				
			),
			&amp;lt;&amp;lt;setTrackEnable( 1 ),
			&amp;lt;&amp;lt;setTrack(
				Function( {this, clickpt},
					this &amp;lt;&amp;lt; setCursor( "Finger" ) /* button-up tracking - use the hand */
				)
			),
			&amp;lt;&amp;lt; Set Click Enable(1), 
			&amp;lt;&amp;lt;Set Click(
				Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
					{DEFAULT LOCAL},
					If( event == "Released" | event == "Canceled",
						this &amp;lt;&amp;lt; setCursor( "Hand" ) /* switch back to hand immediately */
					,
						this &amp;lt;&amp;lt; setCursor( "Finger" ) /* change cursor during drawing */
					);
					If( event == "Pressed",
						img = new image("$SAMPLE_DATA\..\images\Pi.gif");
						img &amp;lt;&amp;lt; Set Size({50, 50});
						
						// EL1 &amp;lt;&amp;lt; Set image(img);
						// if you're making a bunch of these you could find the picture box
						// instead of having a direct reference to it
						// this currently is dependent on the tree structure
						pb  = (this &amp;lt;&amp;lt; Child()) &amp;lt;&amp;lt; Child();
						pb &amp;lt;&amp;lt; Set image(img);
					);
				)
			)
		),
		Panel Box("El 2",
			EL2 = Picture Box(img2),
		),
		Panel Box("El 3",
			EL3 = Picture Box(img3),
		),
		Panel Box("El 4",
			EL4 = Picture Box(img4),
		),
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Apr 2020 15:12:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259833#M50987</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2020-04-22T15:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to open an image file after clicking on Picture Box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259841#M50991</link>
      <description>&lt;P&gt;Thank you for suggestions and code! With opening of an original image I meant opening the file for example in Paint in order examine details of image in original size. Is there way to do that? Regards&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Actually I could create a new window and then open the image again but in original size.&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Ok, I managed to open the new window and display the image (using Paint or something another is actually not necessary). I am providing code from vince_faller with very small changes, maybe it will be helpful for somebody. Thank you once again.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();

New Window("Example",             
    V List Box(
		H List Box(
		mb = MouseBox(
			Panel Box("El 1",  //place for EL images
				EL1 = Picture Box(img1),				
			),
			&amp;lt;&amp;lt;setTrackEnable( 1 ),
			&amp;lt;&amp;lt;setTrack(
				Function( {this, clickpt},
					this &amp;lt;&amp;lt; setCursor( "Finger" ) /* button-up tracking - use the hand */
				)
			),
			&amp;lt;&amp;lt; Set Click Enable(1), 
			&amp;lt;&amp;lt; Set Click(
				Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
					{DEFAULT LOCAL},
					If( event == "Released" | event == "Canceled",
						this &amp;lt;&amp;lt; setCursor( "Hand" ) /* switch back to hand immediately */
					,
						this &amp;lt;&amp;lt; setCursor( "Finger" ) /* change cursor during drawing */
					);
					If( event == "Pressed",					
						New Window("Image",
							img_big = new image("$SAMPLE_DATA\..\images\Pi.gif");
							//img_big &amp;lt;&amp;lt; Set Size({50, 50});
							Picture Box(img_big);
							// if you're making a bunch of these you could find the picture box
							// instead of having a direct reference to it
							// this currently is dependent on the tree structure
							//pb  = (this &amp;lt;&amp;lt; Child()) &amp;lt;&amp;lt; Child();
							//pb &amp;lt;&amp;lt; Set image(img);
						);
					);
				)
			)
		),
		Panel Box("El 2",
			EL2 = Picture Box(img2),
		),
		Panel Box("El 3",
			EL3 = Picture Box(img3),
		),
		Panel Box("El 4",
			EL4 = Picture Box(img4),
		),
	),
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Apr 2020 16:56:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-open-an-image-file-after-clicking-on-Picture-Box/m-p/259841#M50991</guid>
      <dc:creator>lukasz</dc:creator>
      <dc:date>2020-04-22T16:56:53Z</dc:date>
    </item>
  </channel>
</rss>

