Google allows use dp units instead of px for display icons or. Png file when that design icon to submit it? Or what other format? Or to be divided into ldpi, mdpi, hdpi and xhdpi it? Or submit only one file can be? ,,, Do not understand, seek guidance

Reply:
The unit is dp or px, there is no relationship with the pictures, images or use png, it is best to prepare dpi different different picture, so you can get the best display, and in the absence of scaling, displayed image size you put the folder with the picture size is the same. If in order to save space, try to use a little high-resolution pictures, so reduce the display without distortion.
ldpi = 120dpi, mdpi = 160dpi, hdpi = 240dpi, xhdpi = 320dpi.
The formula sized pictures in other dpi display is: target dpi / Original dpi × original size
Assuming you have only one picture, put xhdpi directory, image size is 100 × 200:
Is reduced in a ldpi under: 120/320 = 0.375 times, i.e., 38 × 75
In mdpi is reduced to: 160/320 = 0.5 times, i.e., 50 × 100
In hdpi is reduced to: 240/320 = 0.75 times, i.e., 75 × 150
Assuming you have only one picture on ldpi directory, image size is 100 × 200:
Is amplified in a lower mdpi: 160/120 = 1.33 times, i.e., 133 × 267
Is amplified in a lower hdpi: 240/120 = 2 times, i.e., 200 × 400
In xhdpi is magnified under a: 320/120 = 2.67 times, ie 267 × 533
Reply:
Sorry, did not quite understand, that to do with with the previous unit provides designers with px for style icons What difference does it? Or for a change in the common dp is the code for the icon design personnel did not change, or 36 x 36 px 48 x 48 px 72 x 72 px? Trouble. . .
Reply:
Sorry, did not quite understand, that to do with with the previous unit provides designers with px for style icons What difference does it? Or for a change in the common dp is the code for the icon design personnel did not change, or 36 x 36 px 48 x 48 px 72 x 72 px? Trouble. . .
Reply:
Landlord, "Google allows use dp instead of px units to display the icon for" this sentence would like to express is the height and width in xml configuration picture displayed, for example:
android: layout_width = "100dp"
android: layout_height = "100dp"
Or px, meaning that this control to display images in the width and height of dp, then 1dp converted into px, for example, for hdpi screens, 1dp generally equal 1.5px, for xhdpi, 1dp = 2px (screen pixel density of 2) .
When the icon design is based. Png format or 9.png stored in drawable, drawable-mdpi, drawable-hdpi and other directories, is designed to adapt to different screen sizes, for example, with an application installed on mdpi, hdpi, xhdpi resolution on a different screen phone, it will read to each icon resource mdpi, hdpi, xhdpi directory, you can do so include more phones, of course, if you just put the picture hdpi directory, then all resolutions mobile phones are likely to only use images hdpi directory, this will result in differences on display, either feeling magnified or reduced sensation.
Therefore, third-party applications will generally consider drawable, drawable-mdpi, drawable-hdpi, drawable-xhdpi different pixel sizes, such as directory decentralization with an icon resource (. Png or .9. Png), to accommodate different resolutions of the market phone.
Do not know that the landlord did not understand?
Reply:
dp good, px good, is used in the code, with your real picture size does not matter. Dp units can be used to do to improve application compatibility for different dpi devices, reducing the workload.
dp for a universal code after the change is for the icon design personnel did not change, or 36 x 36 px 48 x 48 px 72 x 72 px? almost mean.
I said that section, meaning that if you have a map, but placed under a certain dpi directory, then on other devices dpi, images are automatically scaled to display out of the picture size is not the same with the original. If you have various dpi directory under this picture, then on different dpi devices, the size of the picture displayed with your original images are the same, will not go zoom.
On different dpi devices, 1dp corresponding px is not the same, the formula is: dips = (pixs * 160) / densityDpi
Reply:
Also, the landlord said: 36 x 36 px 48 x 48 px 72 x 72 px icon resources in three resolutions on different dpi phones, for example, were placed mdpi, hdpi, xhdpi, because xhdpi relative in mdpi, the same size screen size (note the screen size) the need for greater pixel image to display the same size, or else such as 36 X 36 px mdpi this picture on the screen may be relatively normal, but put On xhdpi screen is very small, and this is why.
Reply:
Understand it ~ ~ Thanks meow ~
Reply:
Huh! Understand it meow ~ ~ ~ Thanks
No comments:
Post a Comment