By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,911 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,911 IT Pros & Developers. It's quick & easy.

Image Scaling to a Constant Size for Monitor and Resolution

P: 2
I have a semi-urgent need to solve a problem in Java.

I have three small images that I need to hold to a constant size (e.g., 1 inch) regardless of both monitor size and resolution.

Basically it breaks down to this series of events.

1. Determine the users monitor size.
2. Determine the users screen resolution size.
3. Calculate the height and with to scale the image to for a constant size.
4. Display the image.

The missing piece right now is #1. I know how to determine resolution and from there I can get pretty close, but my results are still going to vary depending on what size monitor the person is using.

I know the answer is out there as I found this link.
http://www.freepatentsonline.com/6982729.html

I'm stumped. Any leads would be greatly appreciated.

My expertise is PHP+MySQL so excuse my ignorance about Java.
Mar 14 '07 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
I have a semi-urgent need to solve a problem in Java.

I have three small images that I need to hold to a constant size (e.g., 1 inch) regardless of both monitor size and resolution.

Basically it breaks down to this series of events.

1. Determine the users monitor size.
2. Determine the users screen resolution size.
3. Calculate the height and with to scale the image to for a constant size.
4. Display the image.

The missing piece right now is #1. I know how to determine resolution and from there I can get pretty close, but my results are still going to vary depending on what size monitor the person is using.

I know the answer is out there as I found this link.
http://www.freepatentsonline.com/6982729.html

I'm stumped. Any leads would be greatly appreciated.

My expertise is PHP+MySQL so excuse my ignorance about Java.
Is this what you are looking for?
Mar 14 '07 #2

P: 2
Is this what you are looking for?
Well... no, what I need is the code to read the size of the monitor screen from the graphics card. I already know how to read the pixel dimensions.

Then, I am going to come up with a formula for the correct scaling to keep the size constant.

I would be happy to post the final working code here (if it does not exist already) if anyone could help me with this step.

Cheers!
Mar 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.