Hello,
As part of a report-making tool I'm pulling a series of images from a zip file into a grid for easy viewing. I have that working as intended, but I'd also like the ability to click on an image to view it at full-size and copy the full-size image to the clipboard (to paste into PPT, etc). I've found this other thread where someone had a similar issue and I've repurposed that script. However, I've noticed some undesirable behavior with the copy picture message. Even though the image properties in the image box say it is 451x451 px just like the original file, copying that image to the clipboard (via JSL or by right-click) results in a smaller image than if I copy the file location directly, and JMP also has added an uneven white boarder.
Is there any workaround to prevent the white boarder when copying from JMP? Or better yet, a way to directly read the file path and copy the full image to the clipboard? My experimentation and searching yielded no results. JMP may not be the ideal tool for this, but I'm already processing all the numerical data with JMP so it makes sense to use same script to open up the images.
Thank you!
Image of PPT slide with two copied images ("tile" sample image) on a gray background. Left is from JMP, right is from the .jpg directly
Sample code for testing
Names Default To Here( 1 );
New Window( "Test",
//create mouse box to make image clickable
mb = MouseBox(
//load in image and shrink for easy viewing
pb1 = Picture Box( Open( "$SAMPLE_IMAGES/tile.jpg", jpg ) ),
pb1 << set height( 100 ),
pb1 << set width( 100 ),
//on click behavior
<<setTrackEnable( 1 ),
<<setTrack(
Function( {this, clickpt},
this << setCursor( "Finger" ) /* button-up tracking - use the hand */
)
),
<<Set Click Enable( 1 ),
<<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 << setCursor( "Hand" ) /* switch back to hand immediately */
,
this << setCursor( "Finger" ) /* change cursor during drawing */
);
If( event == "Pressed",
New Window( "Enhance!",
//open now window with full-size image
pb2 = Picture Box( Open( "$SAMPLE_IMAGES/tile.jpg", jpg ) ),
//copy image to clipboard
pb2 << copy picture,
)
);
)
)
),
);