|
In AS3, I have a Sprite that has a Z axis rotation applied.
How do I calculate that Sprite's dimensions (it's original size) from Sprite.rotationZ and Sprite.getRect(...)?
Started by Ben on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It can also be done without ever seeing it visually if you switch the rotationZ back once you get your width and height, like ... .
Antpaw's answer is best / easiest.
Sprite.width and sprite.height on sprite.rotationZ = 0 would give you the original size .
|
|
Many array methods return a single index despite the fact that the array is multidimensional. For example:
a = rand(2,3) z = a.argmax()
For two dimensions, it is easy to find the matrix indices of the maximum element:
a[z/3, z%3]
But for more dimensions...
Started by Steve on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Got it!
a = X.argmax() (i,j) = unravel_index(a, X.shape)
I don't know of an built-in function that does what you want, but where this has come up for me, I realized that what I really wanted to do was this:
given 2 arrays a,b with the same shape, find... .
|
|
How would you store a vector of N dimensions in a datatable in C#?
Started by LittleBoy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
An example using an Array of unknown dimension:
int[] dimensions = { 3, 2, 5 }; // etc Array arr = Array.CreateInstance( typeof(int), ....
List<T> etc are feasible if the number of dimensions is known and constant (but > 1).
|
Ask your Facebook Friends
|
Is there a way to determine how many dimensions there are in a PHP array?
Started by Brian on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Nice problem, here is a solution I stole from the PHP Manual :
function countdim($array) { if (is_array(reset($array))) { $return = countdim(reset($array)) + 1; } else { $return = 1; } return $return; }
you can try this:
$a["one"]["two"]["three"]="1"... .
|
|
How can I find out the number of dimensions in an array in Classic ASP ( VBScript ) .
I am being passed an Array with multiple dimensions but I only want to look at the last. Seems easy in other languages.
Started by Brian G on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Function NumDimensions(arr) Dim dimensions : dimensions = 0 On Error Resume Next Do While Err.number = 0 dimensions = dimensions + 1 UBound arr, dimensions Loop On Error....
Than the size of a specified dimension.
|
|
How to get SWF file dimensions in PHP?
Started by From.ME.to.YOU on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I've also read that PHP's getimagesize() has some limited support for SWF files. .
Getimagesize I believe accounts for swfs: http://us.php.net/getimagesize
You could install and run the swfdump utility .
|
|
I'm trying to solve this flickering problem on the iphone (open gl es game). I have a few images that don't have pow-of-2 dimensions. I'm going to replace them with images with appropriate dimensions... but why do the dimensions need to be powers of two...
Started by MrDatabase on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
This would have smaller versions created of dimensions 128x64, 64x32, 32x16, 16x8, 8x4, 4x2, 2x1-of-2 dimensions then a lot of integer....
I'm not sure.
Typically, graphics hardware works natively with textures in power-of-2 dimensions.
|
|
I need to check the dimensions of images in a directory. Currently it has ~700 images. I just need to check the sizes, and if the size does not match a given dimension, it will be moved to a different folder. How do I get started?
Started by john2x on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Then use the os.path.walk function to traverse all the files -> dimensions , then use a list comprehension....
You can use the Python Imaging Library (aka PIL) to read the image headers and query the dimensions the dimensions (using PIL).
|
|
How to prevent CKEDITOR from adding image dimensions as a style?
Instead of this:
<img src="image.jpg" style="height:100px; width:100px;">
I want this
<img src="image.jpg" height="100px" width="100px">
Started by Franek on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
( Avoid deprecated image attributes )....
If you search their bug tracking site, you will see that they try to 'avoid XHTML deprecated attributes' in favor of styling .
I do not believe you can do it without altering the image plugin file of the CKEDITOR. .
|
|
I mean the whole paper, not only the text zone in it.
I want the dvi output to look 1 centimetre x 10 metres in the viewer if I set these dimensions in the tex file.
And I don't want to go through LaTeX for it.
Started by Fabien on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
To control the positioning of text.)
A couple of useful links: The size... .
(And of course set \hsize, \vsize etc.
This is really a dvips extension, but many dvi viewers understand it .
Add \special{papersize=1cm,1000cm} in the first page of the document.
|