0

So I have I project, where I have a lot of picture of brackets and I have to show them according to their reference. The problem is that they have to be scaled (1/1) because size is an important detail for the project. My question is how to display the images in their 1/1 dimension on a 10" tablet when I know their dimensions and resolutions.

I am using Microsoft Visual 2010 web developer for the development (html, css, js and VB.net) I already tried the max-width= 100% .

Shipra Sarkar
  • 1,385
  • 3
  • 10
Azii0803
  • 3
  • 1
  • Duplicate: [Detecting the system DPI/PPI from JS/CSS?](https://stackoverflow.com/questions/279749/detecting-the-system-dpi-ppi-from-js-css) –  Dec 09 '21 at 09:10
  • Btw, the short answer is that can actually do `` (or `12cm` or whatever) –  Dec 09 '21 at 09:14
  • the CSS property `max-width= 100%` applies the width of the parent. Why don't you just set your image width and height to their real pixel size ? – E-telier Dec 09 '21 at 09:24
  • @E-telier That would only work if the image resolution was the same as the device display's resolution. That's not the case though, as you can see in the [px per inch column here](https://screensiz.es/). –  Dec 09 '21 at 10:11
  • @E-telier this will only work for one image, but i have like 1200 with different resolutions – Azii0803 Dec 09 '21 at 12:56
  • @Azii0803 Your server could probably do that for you, but in case it can't you could use `img.naturalWidth` and `img.naturalHeight` (see here : https://stackoverflow.com/questions/1093137/can-javascript-access-native-image-size) – E-telier Dec 09 '21 at 14:19

0 Answers0