Is there a list of screen resolutions for all Android based phones and tablets? [closed]

(out of date) Spreadsheet of device metrics. SEE ALSO: Device Metrics – Material Design. Screen Sizes. ————————— —– ———— ————— ——- ———– —————- — ———- Device Inches ResolutionPX Density DPI ResolutionDP AspectRatios SysNavYorN ContentResolutionDP ————————— —– ———— ————— ——- ———– —————- — ———- Galaxy Y 320 x 240 ldpi 0.75 120 427 x 320 4:3 … Read more

How to maintain widgets aspect ratio in Qt?

You don’t have to implement your own layout manager. You can do with inheriting QWidget and reimplementing int QWidget::heightForWidth( int w ) { return w; } to stay square. However, heightForWidth() doesn’t work on toplevel windows on X11, since apparently the X11 protocol doesn’t support that. As for centering, you can pass Qt::AlignCenter as the … Read more

matplotlib (equal unit length): with ‘equal’ aspect ratio z-axis is not equal to x- and y-

I like the above solutions, but they do have the drawback that you need to keep track of the ranges and means over all your data. This could be cumbersome if you have multiple data sets that will be plotted together. To fix this, I made use of the ax.get_[xyz]lim3d() methods and put the whole … Read more

Resize UIImage by keeping Aspect ratio and width

The method of Srikar works very well, if you know both height and width of your new Size. If you for example know only the width you want to scale to and don’t care about the height you first have to calculate the scale factor of the height. +(UIImage*)imageWithImage: (UIImage*) sourceImage scaledToWidth: (float) i_width { … Read more

Android Camera Preview Stretched

I’m using this method -> based on API Demos to get my Preview Size: private Camera.Size getOptimalPreviewSize(List<Camera.Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio=(double)h / w; if (sizes == null) return null; Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Camera.Size size : sizes) … Read more

CSS force image resize and keep aspect ratio

img { display: block; max-width:230px; max-height:95px; width: auto; height: auto; } <p>This image is originally 400×400 pixels, but should get resized by the CSS:</p> <img width=”400″ height=”400″ src=”http://i.stack.imgur.com/aEEkn.png”> This will make image shrink if it’s too big for specified area (as downside, it will not enlarge image).

Maintain aspect ratio of div but fill screen width and height in CSS?

Use the new CSS viewport units vw and vh (viewport width / viewport height) FIDDLE Resize vertically and horizontally and you’ll see that the element will always fill the maximum viewport size without breaking the ratio and without scrollbars! (PURE) CSS div { width: 100vw; height: 56.25vw; /* height:width ratio = 9/16 = .5625 */ … Read more