Questions tagged [devicepixelratio]

33 questions
1
vote
0 answers

Get device pixel ratio on desktop java

I need to get the device pixel ratio in a desktop Java app to implement correct behavior on MacBook retina screens. The app uses Swing and JOGL. Is there any way to do this via AWT or any JOGL/JOGAMP APIs like NativeWindow or NEWT? JOGL is drawing…
Andy
  • 7,885
  • 5
  • 55
  • 61
1
vote
1 answer

What the visual difference between DPR: 1.0, DPR: 2.0, DPR: 3.0 for human eyes?

For example : I have thumbnail of image in fixed size block 250x250px. And three images:
ratojakuf
  • 708
  • 1
  • 11
  • 21
0
votes
0 answers

How to solve the issue of widgets appearing large on ColorOS phones in Flutter?

I started developing an app in Flutter and the design looks okay on Google Pixel phones with stock Android, but on Oppo, for example, the UI elements look zoomed in. I've checked the display settings and they are different on these two OS-es: on…
PhillauSofia
  • 362
  • 3
  • 9
0
votes
0 answers

width and height img attribute values for devices with devicePixelRatio > 1 - should they be changed?

For devices with window.devicePixelRatio == 1 image 100 by 100 looks good: an image 100 by 100 pixels is used for the square of 100 by 100 - good. For devices with…
Haradzieniec
  • 9,086
  • 31
  • 117
  • 212
0
votes
1 answer

Problem showing real sizes on Apple device's screens (JS)

I need to show real sizes of objects on screen (1mm - 20mm). At the top, I have a button "Calibrate view". I click it and a modal opens where user can calibrate view using a credit card (Put it on screen, and using + and - buttons, he adjusts the…
0
votes
0 answers

Flutter TextTheme assign Device Pixel Ratio (Clean Architecture)

I'm trying to add clean architecture to my Flutter windows application and added some ThemeData to my project. I created a TextTheme and implemented all default sizes to it. Now I want to know if there is a clean way to always assign the default…
Thoxh
  • 149
  • 9
0
votes
1 answer

devicePixelRatio not matching absolute px length

As I understand it, the actual length of a pixel is ~0.265 mm - so a picture having 810 CSS pixels and 1.25 devicePixelRatio should take up 0.265 * 810 / 1.25 =~ 172 mm. But placing a ruler to the screen I read 182 mm. No idea why: Something is…
pmad
  • 89
  • 6
0
votes
0 answers

Chrome not working properly with srcset/sizes of images

When using srcset and sizes for images, browsers seem to have very different behavior. Firefox will load the image referenced in the srcset list that has the same size as the slot or, if there isn't one, the first image that is bigger than the…
dansan
  • 194
  • 2
  • 2
  • 15
0
votes
1 answer

Why do we use the (min--moz-device-pixel-ratio:0) query for the selection of devices using Mozilla Browser?

I was working on a plugin and got a very basic question in mind, would be really grateful if someone can help me out with it. Why exactly do we use (min--moz-device-pixel-ratio:0) query and how does it differ from the other queries. How does it…
0
votes
0 answers

Mouse event's movementX and movementY showing different values in two machines, both with same device pixel ratio. How come?

I have a drag and drop system in which users can drag and element and that dragging should, of course, match the mouse movement. To update the element's position, I use the mouse move events's movementX and movementY properties. It turns out that in…
Edy Bourne
  • 5,679
  • 13
  • 53
  • 101
0
votes
1 answer

Why some rectangles are disappearing when there is a rectangle that covers the whole area?

I'm facing a problem with css paint worklet and am wondering whether it's a browser bug or there's something that i'm doing wrong. In a worklet i'm drawing a few rectangles. If one of them covers the whole area, others are starting to disappear when…
0
votes
1 answer

How to combine multiple "groups" of CSS media queries?

In CSS Media queries, you can use , (for "or") and and to match media query requirements. For example: @media (min-width: 768px) and (min-resolution: 2dppx) { ... } But what if you wanted to mix and and , in the same media query? A good use case…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
0
votes
2 answers

How to use CSS Media Queries on a Retina Screen

I have written the following media query that is not behaving as expected. The change is occurring at 1537px not 1024px. I am using a Retina screen and this code is contained within a SCSS file in a project bootstrapped with create-react-app…
0
votes
1 answer

Download SVG as PNG when devicePixelRatio !== 1

I want to render an SVG to PNG. I do this by writing the SVG to a canvas and downloading the canvas as a PNG. When doing this on a device with a retina display and a devicePixelRatio !== 1 this results in a blurry image. When rendering to the screen…
Jorma Turkenburg
  • 153
  • 1
  • 1
  • 8
0
votes
1 answer

Why device pixel ratio change between web pages on same device and OS?

I Would like to understand why device pixel ratio vary from web site and from different Os. For example on the same device this site got different pixel ratio on Windows / Ubuntu. On Windows the pixel ratio is 1.34 when on Ubuntu is 1. I would like…