Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Screen Capture - is it possible to improve jpg quality?


This topic is 4799 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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))

Posted

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.

Posted

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?

This topic is 4799 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.