473,837 Members | 1,436 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.freepatents online.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 2659
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.freepatents online.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
5427
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 scaled image. I am grateful for anyone's recommendations, - Dave
2
10483
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 have the same name and reside in the following physical path structure:
11
16493
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: 200px; max-height: 200px;"/> but it doesn't keep the ratio - <div style="width: 200px; height: 200px;"><img src="toto.jpg/></div> but the image flow outside the div
0
1501
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 working at all. My strategy is first to save the form's image as a bitmap (this works, I can save the image to a file). Then I use the printer's Graphics object's drawImage method to send it
14
1518
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 by 1 point (starting from the default size), and a last button will reset it to the original size. Pratically, whichever might be the default size (which I set from three css, swapped accordingly to the screen's res), the text inside that table...
4
3834
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: (from the form) Dim per As Decimal per = CDec(zoomit.Value) setzoom(Me, Me.Font, per) ' per is the current value of the trackbar as a
2
19383
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 (height) x 780 (wide) So the "preferred size" would be 440 x 780
3
2535
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 image but I have had varying results on multiple images. Is there anyway to make the text a fixed size on the image. Similar to putting a date on a photograph.
0
3400
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 is when an image comes in the center of the monitor to scale automatically, stay at the max scale for around 2 secs then scale back to its original size. when an image is in the proccess of scaling, the other images should stop and wait until the...
0
9839
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10621
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7806
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6998
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.