cjcj01 Posted October 13, 2011 Posted October 13, 2011 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
john renfrew Posted October 15, 2011 Posted October 15, 2011 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.
Prob Posted October 19, 2011 Posted October 19, 2011 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))
john renfrew Posted October 19, 2011 Posted October 19, 2011 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.
cjcj01 Posted October 20, 2011 Author Posted October 20, 2011 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?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now