Questions tagged [dimensions]

Dimensions of an array define its size and shape -- the arangement of elements in the array. Use this Tag for questions regarding the shape of arrays.

1238 questions
48
votes
4 answers

Get image dimensions with Javascript before image has fully loaded

I've read about various kinds of ways getting image dimensions once an image has fully loaded, but would it be possible to get the dimensions of any image once it just started to load? I haven't found much about this by searching (which makes me…
user828591
  • 1,212
  • 2
  • 17
  • 32
45
votes
6 answers

What does -1 mean in pytorch view?

As the question says, what does -1 do in pytorch view? >>> a = torch.arange(1, 17) >>> a tensor([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16.]) >>> a.view(1,-1) tensor([[ 1., 2., 3., …
aerin
  • 20,607
  • 28
  • 102
  • 140
43
votes
4 answers

Make a

I am working on a web app that will generate an NxN grid based on the user's selection of N. I want the total width of the grid to be relative (ie 100% of the available space) so that users can print on various paper sizes. I can easily calculate…
Nate
  • 2,035
  • 8
  • 23
  • 33
43
votes
2 answers

Different values folders in android

I am creating different values folders in my app (values, values-ldpi, values-mdpi, values-hdpi, values-xhdpi, values-nodpi, values-w360dp-mdpi). But some devices that belong same category. But having different screen sizes. But I see give font size…
John R
  • 2,078
  • 8
  • 35
  • 58
38
votes
6 answers

Assigning 'wrap_content' or '-2' to dimension

I want to create a dimension that would be equal to 'wrap_content' constant. So according to developer.android.com Reference I write: -2 But ADT says: Error: Integer types not allowed (at…
c00p3r.web
  • 808
  • 3
  • 10
  • 21
38
votes
13 answers

VideoView to match parent height and keep aspect ratio

I have a VideoView which is set up like this:
Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
37
votes
8 answers

Is there a simple way to get image dimensions in Ruby?

I'm looking for an easy way to get width and height dimensions for image files in Ruby without having to use ImageMagick or ImageScience (running Snow Leapard).
gruner
  • 1,572
  • 2
  • 15
  • 26
36
votes
10 answers

How to return the number of dimensions of a (Variant) variable passed to it in VBA

Does anyone know how to return the number of dimensions of a (Variant) variable passed to it in VBA?
user533978
  • 400
  • 1
  • 3
  • 7
33
votes
3 answers

Iphone: Get current view dimensions or screen dimensions

Hello i want to get the width and height of my main view. I want the correct value in landscape or portrait mode. I've tried the following: NSLog(@"aaa %f", [UIScreen mainScreen].applicationFrame.size.width); NSLog(@"zzz %f",…
gyozo kudor
  • 6,284
  • 10
  • 53
  • 80
32
votes
8 answers

Check image dimensions (height and width) before uploading image using PHP

How can I check for height and width before uploading image, using PHP. Must I upload the image first and use "getimagesize()"? Or can I check this before uploading it using PHP? $error)…
Hakan
  • 3,835
  • 14
  • 45
  • 66
31
votes
2 answers

How to get the height and width of an ImageView/Bitmap in Android

I want to get the height and width of an image bitmap that is either in ImageView or a background image. Please help me, any help will be appreciated.
abhishek ameta
  • 2,326
  • 7
  • 28
  • 35
30
votes
5 answers

how to obtain a CCSprite's width and height in cocos2d for iphone

That's the question xD Given an instance of a CCSprite in cocos2d in iphone, what method can I use to obtain the image width and height?
Manuel Araoz
  • 15,962
  • 24
  • 71
  • 95
30
votes
3 answers

How do I get natural dimensions of an image using JavaScript or jQuery?

I have this code so far: var img = document.getElementById('draggable'); var width = img.clientWidth; var height = img.clientHeight; However this gets me the html attributes - css styles. I want to get dimensions of the actual image resource, of…
user1848605
  • 717
  • 2
  • 8
  • 13
29
votes
6 answers

Find the dimensions of a multidimensional Python array

In Python, is it possible to write a function that returns the dimensions of a multidimensional array (given the assumption that the array's dimensions are not jagged)? For example, the dimensions of [[2,3], [4,2], [3,2]] would be [3, 2], while the…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
25
votes
2 answers

Accessing image dimensions on an ImageField in a Django template?

I have ImageField in my model and I'm able to display the image in a template. However, how do I retrieve the image's height and width?
olegmil
  • 347
  • 1
  • 4
  • 10
1
2
3
82 83