October 13, 201114 yr Hi, is it possible to improve the jpg quality that ScriptMaster uses in the Screen Capture function? It's very pixelated for what I need. Thanks Chris
October 15, 201114 yr Save the capture as a png?? Change the code to this... import java.awt.Rectangle import java.awt.Robot import java.awt.image.BufferedImage import javax.imageio.ImageIO x1 = left.toInteger() y1 = top.toInteger() x2 = width.toInteger() y2 = height.toInteger() BufferedImage sc = new Robot().createScreenCapture(new Rectangle(x1, y1, x2, y2)) //insert your own path here file = new File('screencapture.png') ImageIO.write(sc, 'png', file) Then you can import that file back into a FM container. It IS only ever going to be 72dpi though.
October 19, 201114 yr Hi John, Thanks for the code info; just to clarify (I'm new to ScriptMaster), this is replacing the following? import java.awt.*; int x1=Integer.valueOf(left); int y1=Integer.valueOf(top); int x2=Integer.valueOf(width); int y2=Integer.valueOf(height); new Robot().createScreenCapture(new Rectangle(x1, y1, x2, y2))
October 19, 201114 yr yes You need the first lines explicitly to be able to access some of the bottom lines and you don't need to import all of the java awt class. Then effectively you are explicitly saying you want the result of the capture as buffered content which you can then write to a file with the last 2 lines.
October 20, 201114 yr Author John, just wanted to say thanks for your reply. I ended up capturing an image 50% bigger (in dimensions) than I wanted then just resizing the container down to the size I wanted and it looks fine. Thanks for your tip about saving out as a .png file. I guess I could feed it the Get (TemporaryPath) from a Filemaker function?
Create an account or sign in to comment