Questions tagged [pixel-ratio]

39 questions
1
vote
0 answers

Screen width battle: Webview vs Firefox vs Chrome

I made a simple web browser with a webview in Android, but for some reason I am getting inconsistent pixelRatios. I also got a wrong UserAgent, but I fixed that already. I tested this in a 1080x2400 phone with javascript using…
Luis A. Florit
  • 2,169
  • 1
  • 33
  • 58
1
vote
0 answers

CSS upscaling / force resolution

I'm working on a webgame and for performance reasons I'd like to render the UI at a certain resolution (lets say 640x480) and scale it up (just like you'd do with an image). Some transformations and background effects require quite some…
Martijnh
  • 333
  • 2
  • 10
1
vote
2 answers

render pdf in high quality using pdf.js

I'm trying to display a pdf using pdf.js. I am able to display it correctly on all devices. But, on retina display and 4k display it's blurry. I found here, here and here, that i must use the value window.devicePixelRatio but I'm not a Javascript…
s.zane
  • 135
  • 3
  • 13
1
vote
2 answers

Retina display device width is not autofit in on ipad when using device width

Currently I am working for a website where I used Retina Ready Coding. The retina display (new iPad) has a resolution of 2048 x 1536 pixels while the general iPad/Tab has resolution of 1024x768 pixels. As per Retina’s law, Whenever I used body width…
1
vote
1 answer

Requiring static images in React-Native

My RN app (v0.19.0, ios and android) requires a loading/splash screen (there can be occasionally some data to load at startup), so I am trying to understand how to provide the right set of images for this screen across various devices. Code is: …
alphadogg
  • 12,762
  • 9
  • 54
  • 88
1
vote
0 answers

How to optimize canvas circle for retina devices?

Please tell me how to make canvas look sharp for retina devices? I would be grateful if you show in my example - fiddle var canvas = document.getElementById('timer'); var context = canvas.getContext('2d'); var x = canvas.width / 2; var y =…
rd2d2
  • 125
  • 3
1
vote
1 answer

Responsive Images Based On Device Pixel Ratio

I am confused about responsive images. How Device Pixel Ratio can affect an image when viewed on a mobile device. I have a mobile device with resolution 480x854 with device pixel ratio as 1.5 i.e. if I send an image with width 320px (480/1.5), it…
user2538076
  • 173
  • 1
  • 2
  • 18
1
vote
0 answers

CSS pixel ratio in css media query

I am developing a website and in it I am using media queries. My Example Query is shown below only screen and (min-resolution:161dpi) and (max-resolution:192dpi), only screen and (-webkit-min-device-pixel-ratio:…
saadsaf
  • 1,421
  • 1
  • 17
  • 28
1
vote
1 answer

Decreasing the pixel ratio for an embedded google map (phonegap - android hybrid app)

I've been developing an app which presents a google map for the user, this app should run on samsung S2, S3 and S4. This means device pixel ratios of 1.5, 2.0 and 3.0, which results in a problem : while on the samsung S2 the street names are big…
GrizzlyMcBear
  • 304
  • 1
  • 15
1
vote
1 answer

Phonegap Android pixel-ratio issue - Images, Page width not reliable

When I created a PhoneGap application previously, the images rendering on the pages are not correctly displayed on high DPI devices. So I made the web page with fixed pixel ratio: 1 for all devices without considering device DPI. But this will…
IvenMS
  • 525
  • 5
  • 19
0
votes
1 answer

OpenLayers 6.5 - Change pixelRatio during runtime

in OpenLayers 5.3 we used to do this to change pixelRatio of all the layers in map: this.map.pixelRatio_ = newRatio; this.map.updateSize(); However, in OpenLayers 6.5 this effects only vector layers and not for example tile layers with XYZ…
Gal
  • 182
  • 3
  • 12
0
votes
1 answer

How to change pixel_ratio in pyglet?

I coded a game using pylet. It uses a static window with width 1600 and height 900 assuming users have a fullHD display so everything will be visible. However on some devices (with small displays) the window is way bigger as expected. I figured out…
FinnK
  • 210
  • 4
  • 10
0
votes
1 answer

Where I can find the Pixel Ratio of the device detail?

Where I can find the Pixel ratio for the devices like Sony Xperia XA1, OnePlus 6T and etc. Is there any API or website available or any formula is available to get it? for ex: Apple iPhone 6s Actual Resolution: 750 x 1334 CSS Pixel Ratio: ??
Dhanapal
  • 350
  • 2
  • 7
  • 29
0
votes
1 answer

Adjust cordova screen width on xhdpi

I've a problem with a Cordova app I'm working on. I used a mdpi device for my tests and everything looks fine. I've got a width of 800 and a density value of 1. My view port is set like this:
0
votes
1 answer

How to scale thumbnails based on the device resolution?

I have these media query rules that specify how many thumbnails should fit inside a row, depending on the window width: @media only screen and (min-width: 250px){ li{ max-width: 100%; } } @media only screen and (min-width: 700px){ li{ …
thelolcat
  • 10,995
  • 21
  • 60
  • 102