I am currently looking at bootrap 5 ratio as seen here:
https://getbootstrap.com/docs/5.0/helpers/ratio/
By default there are four classes:
.ratio-1x1
.ratio-4x3
.ratio-16x9
.ratio-21x9
I was wondering if I got this correctly when it comes to the dimension of each ratio.
For instance:
ratio-1x1: 1080 x 1080 pixel
ratio-4x3: sized at 1024 x 768 pixels
ratio-16x9: 1920 x 1080 pixels
ratio-21x9: 2560×1080 pixels
Is this correct? Please enlighten me.
Related
If you go to any phone specifications on any website they usually have resolutions like:
1080 x 2340 pixels, 19.5:9 ratio (~409 ppi density)
720 x 1280 pixels, 16:9 ratio (~294 ppi density)
But using the same phones and going to a website that uses max-width of 600px, the media query still works. Also when checking the resolution on whatismyresolution it says that the width is 360px and the height is around 700px on both phones. How is the resolution calculated on the browser?
To get the resolution of a mobile device we need to multiply the screen width and height with the device pixel ratio.
i.e. window.screen.width * window.devicePixelRatio and window.screen.height * window.devicePixelRatio.
Re the media query does works with max and min width as well as height , so we can define the resolution accordingly in css or less code if we target any specific resolution to support or target.
Imagine devices with resolutions
a) 300px x 400px
b) 600px X 800px
c) 900px x 1000px
Now if create a web page with a div whose width is 150px. Irrespective of all other factors (including browser)
it should occupy half of width in first device.
1/3rd of width in the second device.
1/4th of width in the third device.
However, the absolute size of the div depends on the screen size.
This was my assumption. This held good in few devices and breaks in others. What other dimension am I missing?
It depends on screen resolution.
Consider an old iphone and an iphone with retina dispay.
The old iphone's screen is 320 x 480 pixels.
The iphone with retina display has a 640 x 960 pixels screen.
However, both screens are the same physical size (3.5 inches) and a 300 pixels wide square is rendered at the same physical size on both.
Both devices have a logical screen size of 320 x 480 points :
On an old iphone, every point is 1 x 1 pixel.
On an iphone with retina display, every point is 2 x 2 pixels.
When you set width: 150px, it'a actually 150 points.
A zoom-factor of 2 is applied on the iphone with retina display.
The square is actually rendered 300 pixels wide to match the physical size of the non-retina one.
See this site for size table : screensiz.es
Width gives you the actual pixel width.
Device with gives you the logical width.
Pixel density gives you the zoom factor.
Check the Galaxy SIII for exemple :
Pixel density is 200% (zoom-factor of 2), width is 720 but device-width is actually 360 (device-width divided by zoom-factor => 720 / 2).
I want to decrease an 480 X 480 bitmap image size to 30 X 30 pixel size but keeping the whole height and width intact. (I do not want to scale or use height/width property! )
So if i divide 480/16 = 30. So i need to take average pixel values of 30 pixel elements and put it into new image.
How to take the average in actionscript 3.0? I looked at getpixels() method, is their any simple way/methods to achieve this?
Let me put in more simple way - I am trying to reduce pixels in an bitmap image from 480 X 480 to 30 X 30, the height and width remain same and i expect some amount of distortion after converting image to 30 X 30.
I did scaling but it reduces width and height, if i again increase width and height it just regains normal pixels. Thanks!
Why don't you simply then make a copy of the whole image in code, but use the simple scaling to scale the copy, and only present that to the user. Also look at this from Stack Overflow
How to resize dynamically loaded image into flash (as3)
and i want to make its width and height same as A4 Page
can ay one tell me whats the size?
note : not neccessary to be the exact width and height !!
It depends on the resolution:
72 dpi (web) = 595 X 842 pixels
300 dpi (print) = 2480 X 3508 pixels
600 dpi (print) = 4960 X 7016 pixels
As can be seen here (wikipedia) you will need to make it 210mm × 297mm.
Converting millimeters and centimeters to pixels (and the other way around) depends on the DPI of the screen you are using - it is not a constant.
See this SO question and answers.
My local photo lab told me A4 dimensions are 21x29.7cm and 8.3 x 11.7 inches.
But, and this is just FYI, when it comes out of their machine you do lose a couple of millimeters from each edge, so most important is to make sure you have configured the output from within your postprocess software (i.e LightRoom or PhotoShop etc) otherwise the composition will be screwed.
QVGA is 240 x 320, then WQVGA is 240 x 400, or 240+ x 400?
From Wikipedia:
Wide QVGA or WQVGA is any display resolution having the same height in pixels as QVGA, but wider. This definition is consistent with other 'wide' versions of computer displays.
...
WQVGA resolutions are common used in touch screen mobile phones, such as 240×400, 240×432, and 240×480. Other devices like Apple iPod nano uses a WQVGA screen, 240x376 pixels.
(There are more details on the wikipedia page.)
240, but:
WQVGA has also been used to describe displays that are not 240 pixels
high, for example Sixteenth HD1080 displays which are 480 pixels wide
and 270 or 272 pixels high. This may be due to WQVGA having the
nearest screen height.
https://en.wikipedia.org/wiki/Graphics_display_resolution#WQVGA_.28400.C3.97240.29
So 240 (but also 270 or 272) width (or height in landscape mode) with heights of e.g. 360, 376, 384, 400, 428, 432, 480 pixels. (see table.)