473,503 Members | 11,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image Scaling to a Constant Size for Monitor and Resolution

2 New Member
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
2 2637
r035198x
13,262 MVP
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
dpicella
2 New Member
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

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

Similar topics

4
5404
by: D. Alvarado | last post by:
Hello, Can anyone recommend a good image scaling program for PHP 4. What I'm really looking for is just a function that takes an image file and a width to which to scale the image and outputs the...
2
10457
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
11
16458
by: Stephane D'Alu | last post by:
Do you know if it is possible to have an image to be scalled to a maximum width/height, but with keeping its aspect ratio. The two ideas I had were: - <img src="toto.jpg" style="max-width:...
0
1470
by: JF Turcotte | last post by:
Hi I'm unsuccessfully trying to print a form's image under VB.NET. To print under .NET is a real pain in the , I find it to be complex, lenghty, confusing, upsetting and ultimately not to be...
14
1476
by: Cartel | last post by:
Hello, I wish to modify the dimension of the font within a given table (that is, not yet in the whole page); when I hit a button, the font's size increases by 1 point; another button decreases it...
4
3816
by: Bernie Yaeger | last post by:
I'd like to allow the user to zoom a window using a trackbar, say from 80% to 120% the size of the original window. I'm trying to do this with the following code, but it fails pretty miserably:...
2
19345
by: Farce Milverk | last post by:
Hi, I'm looking for an algorithm to resize an image of arbitrary size to a "fixed" / required width and height. For example, my application requires that images be no larger than 440 pixel...
3
2480
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
0
3375
by: dimkar | last post by:
I finished my first design in flsh 8 using autoscript. It is a carousel gallery of 14 images rotating around. I am very new to this area but i hava a knowledge on programming language. What i want...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.