Home  >  Q&A  >  body text

用java代码获取图片实际的长和宽(单位为毫米),不是获取当前图片长和宽的像素个数

伊谢尔伦伊谢尔伦2766 days ago411

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 16:13:29

    The DPI of the picture is used as a reference for the printer, so that the printed picture can match the actual size when scanning or designing.

    In a broad sense, a display screen is also a printer, and its DPI accuracy is usually 72, which is 72 pixels per inch. This is the DPI under the standard resolution of the monitor. If the screen resolution is adjusted, the DPI will also Follow the changes.

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 16:13:29

    1. The actual display size of the same picture is different on monitors of different sizes and resolutions
    2. Scaling the picture will also change the size

    If you don’t care about the above two points, here are some ideas when there is no DPI data. First, you must find a way to get the physical size (mm) and screen resolution (pixels) of the display, and then get the image size (pixels). There are these three The final result can be calculated using the data

    In addition, DPI (Dots Per Inch) refers to the number of dots per inch. Using the DPI picture width and height pixels and screen PPI (pixels per inch, that is, resolution), you can calculate the size of the picture on the monitor

    reply
    0
  • Cancelreply