image-size

Resize images in GridView on Android

南楼画角 提交于 2019-12-20 10:12:10
问题 I follow this tutorial to create a GridView : This line: imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); Size 85x85 is great for my Wildfire, but on HTC Desire it looks very small. How can I change the image size according to the screen? I have 2 different layouts, but Gridview hasn't any attribute in the XML files to change the image size. 回答1: You could try to make an adjustment based off the pixel density of the current device you are on. DisplayMetrics metrics = new

Set image max size

和自甴很熟 提交于 2019-12-19 17:34:29
问题 I need to set maximum height and width of a image in <img> tag. For example say max size is 400x400 px so if the image size is smaller than this then it will show the image as it is and if size is bigger then this then it should be compressed to this size. How can I do this in html or javascript? 回答1: Set the max-width and max-height in CSS max-width: 400px; max-height: 400px; 回答2: try using a div tag of that size and putting image inside: <div style="width:400px; height400px;> <img style=

Android. Obtaining image size from it's resource id

流过昼夜 提交于 2019-12-18 01:53:41
问题 This is a part of my Activity: private ImageView mImageView; private int resource; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resource = getIntent().getIntExtra("res", -1); Matrix initMatrix = new Matrix(); mImageView = new ImageView(getApplicationContext()); mImageView.setScaleType( ImageView.ScaleType.MATRIX ); mImageView.setImageMatrix( initMatrix ); mImageView.setBackgroundColor(0); mImageView.setImageResource(resource); } I try to

Android. Obtaining image size from it's resource id

北城余情 提交于 2019-12-18 01:53:26
问题 This is a part of my Activity: private ImageView mImageView; private int resource; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resource = getIntent().getIntExtra("res", -1); Matrix initMatrix = new Matrix(); mImageView = new ImageView(getApplicationContext()); mImageView.setScaleType( ImageView.ScaleType.MATRIX ); mImageView.setImageMatrix( initMatrix ); mImageView.setBackgroundColor(0); mImageView.setImageResource(resource); } I try to

Image size limitations in mobile safari?

五迷三道 提交于 2019-12-17 19:00:05
问题 I'm working on an iOS app using PhoneGap. I ran into an annoying problem where some of my images weren't loading. Thinking it was a cache issue I played around swapping images. I finally discovered that the issue had to do with the height of my image. After a whole bunch of trial and error I discovered that an image taller than 7864px will not load in the iPad simulator or the iPad itself. It will load fine in Safari. It's not a file size limitation as these are only 45k in size and I'm

How to check the image file size in jquery?

人走茶凉 提交于 2019-12-13 23:39:08
问题 I have a button while clicking that button I need to get the image file size function attachPhoto() { var path="http://www.w3schools.com/images/pulpit.jpg";// i need to check size of image } <input type="button" style="width:30%" onClick=" attachPhoto()" /> 回答1: $('image').width() and $('image').height() Only after it has fully loaded (maybe attach it to the .load() event). 回答2: $('element').width() or $('element').height() 回答3: If you want to get the dimensions of a file using only a URL,

Out of memory on loading a Image with System.Drawing.Image [duplicate]

馋奶兔 提交于 2019-12-13 10:59:47
问题 This question already has answers here : out of memory Image.FromFile (7 answers) Closed 6 years ago . System.Drawing.Image original = System.Drawing.Image.FromFile(photo); That's the code where i have the problem " Out of memory ." " photo " is a path of an image which the size is 6400x6400 . Have anyone idea about that? 回答1: Is this C#? I think the answer may be here. out of memory Image.FromFile Top Answer from user: https://stackoverflow.com/users/31158/jordao In the Image.FromFile

standard sizing for cross browser cursor images?? jquery change of cursor images

杀马特。学长 韩版系。学妹 提交于 2019-12-13 07:07:55
问题 My cursor images were working as saved 128px x 128px pngs but now they are not in any browser :( did something change?? I have posted a problem a few days ago regarding my cursor images not changing with a onclick for my drawing application. I had help with my initial problem and you can see it is being called properly in the console and everything is great, but the image won't change from the brush image. I think it might be something to do with the sizing but I am not 100% sure. Any help

Responsive images gallery bootstrap 3

試著忘記壹切 提交于 2019-12-13 05:25:00
问题 I am trying, a few days now, to make a gallery with images with slightly different size, but with the same layout. As I can make it work in md view by forcing a 400px max-width for the container div, the workaround would create a gap below each image in xs and sm views. What I want to achieve is have a gallery with images of same max-width and same max-height, and of course, not distorted. http://www.bootply.com/qsy3HNl8DK Non responsive layout example: http://jsfiddle.net/npek7uxh/ <div

Get the size of an image after resizing in iPhone sdk

孤人 提交于 2019-12-13 05:00:26
问题 I have image view on which i am displaying image selected from library. To display the fine quality picture i used to rescale the picture using below method. The image quality i am getting is perfect but i need to set the imageView frame according to the size of newly created image. but when i use newImage.size.width it is giving me the width of original image view. Please help me to set the image view frame according to displayed image size. Thanks in advance -(UIImage *)scaleImage:(UIImage