BookmarkSubscribe
Choose Language Hide Translation Bar
pen51
Community Trekker

Transparent window / screenshot

Is there a way to open a "transparent window" in JMP? The goal is to effectively take a screenshot of a segment of the screen, then place points on the image that was taken. Sort of like a snipping tool, but all in a JMP window. I have a script where I can open and image and do the same thing, but is there a way to take the image straight from the screen?

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: Transparent window / screenshot

It makes sense that the Python code would store the screen shot as a .png (most likely) or .jpg (maybe). The python code needs to communicate the name of the file it saved back to JMP, or simpler, maybe JMP can tell the Python program where to save the screen shot. That would typically be done with command line options you could pass in with RunProgram.

The next step is to load the saved file in JMP; you can use

img = newimage("c:/...screenshot.png");

to open the image and

newwindow("captured image", img);

to display it, and

matrix = img<<getpixels;

to grab the pixels into a matrix you can work with.

 

Craige
6 REPLIES 6
pen51
Community Trekker

Re: Transparent window / screenshot

Bumping this... Any ideas out there?

0 Kudos
Jeff_Perkinson
Community Manager Community Manager

Re: Transparent window / screenshot

I'm afraid I don't understand exactly what you're trying to do. Can you give some more context and describe it differently?

-Jeff
0 Kudos
pen51
Community Trekker

Re: Transparent window / screenshot

I want to be able to perform image analysis on a "screenshot" of the screen. You could always take a screenshot, save the image, then open it in JMP. Instead of having to do this, is there a way to take directly from what is on the screen and analyze that in JMP? It would be bypassing the save and open step.

 

The best example I could think of was with the snipping tool, where you "snip" from the screen, then what you snipped is open in a new window. (Sorry for the screen-ception below)

 

 

snippingtool.pngsnippingtoolwindow.png

0 Kudos
Craige_Hales
Staff (Retired)

Re: Transparent window / screenshot

Have not tried this... Windows power shell script claims to take a picture. You could run this PS script from JMP using RunProgram(). There is probably a similar capability on MAC.

Here's a Python version that might work on Win and Mac. Again, using RunProgram() to run the external program.

RunProgram and Python question.

Craige
pen51
Community Trekker

Re: Transparent window / screenshot

Great, thank you, Craige! I used the Python script, and it opens an image just in photos. Do you know of any way to specify to open it in a JSL window from the Python code? I'm not clear with how the Python-JSL relationship works. Can you go back and forth between the codes? My understanding of it now from browsing the forum is that the JSL script will run, then the Python will and finish before the next part of the JSL begins.

0 Kudos
Highlighted
Craige_Hales
Staff (Retired)

Re: Transparent window / screenshot

It makes sense that the Python code would store the screen shot as a .png (most likely) or .jpg (maybe). The python code needs to communicate the name of the file it saved back to JMP, or simpler, maybe JMP can tell the Python program where to save the screen shot. That would typically be done with command line options you could pass in with RunProgram.

The next step is to load the saved file in JMP; you can use

img = newimage("c:/...screenshot.png");

to open the image and

newwindow("captured image", img);

to display it, and

matrix = img<<getpixels;

to grab the pixels into a matrix you can work with.

 

Craige