How to know the image dimensions in pixels to fit all screens

Ahmad Jamous

I'm working on a react native application in a company and my manager asked me what is the best image size in pexels to upload from API (dashboard) to fit the View in the application ?

And I'm using percentage units not numbers: (width: '80%', height: '50%') I don't know what is the best sized of images to fit or the aspect ratio of the image and react native is unitless!

What should we add 'Hint' for the client in the dashboard when he upload any image ? Or how could I know the best image dimensions to fit all screens ?

STBox

In our organisation, we usually follow the following convensions to make an image fully responsive.

  1. Get the dimentions of the image using: const {width, height} = Image.resolveAssetSource('path-to-your-image');
  2. Get the ratio factor of width and height by using: const ratioFactor = height/width;
  3. Whenever you set the width of your screen by 'n' digit, set the height to 'n*ratioFactor'
  4. In this ways the image can never be stretched or compressed. It will be fully responsive according to it's dimensions.
  5. Preferably use image with standard dimentions as 1024 x 768 pixels.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to fit my background image to different screens?

Background image is not fit on different screens

Getting image dimensions in pixels in ImageView

Frame an image: How to make a shape's dimensions fit around an image?

How to sum all the pixels of a PIL image?

How to fit whole image in to div which have his dimensions

NetLogo: How to make sure background image dimensions fit a world size?

Android - How to know maximal size/dimensions of the image that the device can load

Background image to fit 3.5" and 4" screens

Scale and center div to fit on all screens

how to Fit image view in the Screen in all iPhoneScreens

How to fit image into a box of all aspect ratio?

Convert all white pixels in the image into black pixels

OpenCV - How to add a vale to all the pixels in a part of an image?

How to use numpy.where to change all pixels of an image?

How can I obtain all the image pixels from a UIImage object

How to gray scale an image with transparent pixels making all of them opaque?

How to used linspace matlab function to get the and the y of all pixels in image?

How to loop through all pixels of an image in a windows phone 8 app

How to get screen dimensions as pixels in Android

How to fit a 3 D plane Pi on some image pixels using SVD and RANSAC?

Get all pixels of an Image [Wand]

How to resize an image for smaller screens?

How can i know if there are white pixels in a binary image in some coordinates (stored in a list) in python?

How to restart all Navigation screens?

Slicing a huge image to parts with dimensions of more than 1000 pixels

How do I 'fit a line' to a cluster of pixels?

iOS: display an image with the same quality for all screens

Always the same size of image on all screens

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive