This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Relation between pixel,cm,mm

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone tell the relation between pixel,cm,mm
1cm = 10mm
2.54cm = 1 inch
1 pixel = ?cm or ?mm
I need this info for html table width and height.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The missing information you need is the pixel size, typically expressed as dpi (dots per inch).
For most display screens (CRT/TFT etc), there seems to be a default assumption of 75dpi. For other devices there is no default, it depends on the device (e.g. HP printers are often 300, 600 or 1200 dpi etc., Epson printers are often 720, 1440, 2880 dpi etc.)
In your software you can't ever specify how large something on the screen is in real-world units. You can't know in advance what size the user's screen is and what resolution they have it set to.
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frank!..
 
Ranch Hand
Posts: 4702
9
Scala Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the vast majority of people have their resolution set at 800X600 and the browser window maximum size. the browser frame and scroll bar take up a little of that. so a width of just under 800 will fill the screen(however big it is) considering the fact that some have a higher resolution setting, i often set my table width to 100% that way things spread out instead of having a blank area on the right side. usually you will want a combination of relative and absolute widths. even if your table is not intended to fill the whole width, you can use relative instead of absolute. for example with width=50% the table will use half the width of the window no matter what the resolution or screen size is. hope that helps some.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the vast majority of people have their resolution set at 800X600 and the browser window maximum size.
I've never really looked at statistics on this, but it seems to me as though the vast majority of people have resolution above 800x600. I'd assume 800x600 is the minimum size you can be expected to design for - but realize it will vary a lot from user to user.
 
Saloon Keeper
Posts: 21126
131
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amusingly, the inch is officially defined these days in metric terms. That is, one inch is EXACTLY 2.54cm.
Nominal screen pixel size is 72/inch. If you want more precision, consider that monitor specs are freqently advertised at around .28.
Where EXACT physical screen size is important, applications usually request calibrations. For example, The Gimp pulls info from the windowing system, and also allows you to type in the actual measurements you get by holding a ruler up to your screen and telling it what size displayed reference lines are.
My guidelines are that stand-alone applications should (with rare expections) be runnable on a 640x480 display and web apps should be usable in an 800x600. Probably most people can do at least 1024x768 these days, but why force them?
It's almost impossible to force the physical sizes in an html table. If you're looking to generate a report and want to ensure that the tables come out properly, you're better off generating a PDF.
Even discounting the peculiar problems of HTML, a general-purpose program should be tested at multiple resolutions - the text fields often actually take up MORE space on a higher-resolution display under MS-Windows!
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!