image-size

Image size for all screen devices

微笑、不失礼 提交于 2019-11-26 06:37:47
问题 I have PSD , resolution of that is 1080X1920 , it contains a Dot image whose resolution is 22X22 . I have cropped that image and put it in my res folder. My question is how would Android know that the image is for 1080X1920 screen. It would open the same image bigger in small screen and smaller in 2560x1440 resolution. Is there a way other than putting different images for each screen sizes to tell android to use the image for specific screen size and scale for other screens 回答1: use directly

Check image width and height before upload with Javascript

倖福魔咒の 提交于 2019-11-26 03:19:58
问题 I have a JPS with a form in which a user can put an image: <div class=\"photo\"> <div>Photo (max 240x240 and 100 kb):</div> <input type=\"file\" name=\"photo\" id=\"photoInput\" onchange=\"checkPhoto(this)\"/> </div> I have written this js: function checkPhoto(target) { if(target.files[0].type.indexOf(\"image\") == -1) { document.getElementById(\"photoLabel\").innerHTML = \"File not supported\"; return false; } if(target.files[0].size > 102400) { document.getElementById(\"photoLabel\")

Android background image size in pixel

本小妞迷上赌 提交于 2019-11-26 02:19:18
问题 I would like to create a background image for different resolutions in Android. So I need the values (in pixel) for ldpi, mdpi, hdpi,xhdpi and xxhdpi. It is important that the image will not be blurred. I have already read the Documentation about multiple screen support but there are sizes in dp instead of pixel. 回答1: there is no full list of screen resolutions, there are no fixed values in pixels for ldpi, mdpi, hdpi,xhdpi and xxhdpi. Every android device may have different resolution. If

Get file size, image width and height before upload

a 夏天 提交于 2019-11-25 22:38:59
问题 How can I get the file size, image height and width before upload to my website, with jQuery or JavaScript? 回答1: Multiple images upload with info data preview Using HTML5 and the File API Example using URL API The images sources will be a URL representing the Blob object <img src="blob:null/026cceb9-edr4-4281-babb-b56cbf759a3d"> const EL_browse = document.getElementById('browse'); const EL_preview = document.getElementById('preview'); const readImage = file => { if ( !(/^image\/(png|jpe?g|gif