# Thread: How to resize an active to exact pixel dimensions?

1. ## How to resize an active to exact pixel dimensions?

I know there's scale thing, but it's more of a multiplier of width/height of an object. I want to affect width/height precisely in runtime. So e.g. I have 20x30 active and I want to resize it to be exactly 234x967. How do I do that?

2. You can set:

X scale to 234.0 / 20 (or directly 11.7)
Y scale to 967.0 / 30 (or directly 32.24)

make sure you use floating point values because scales need a float to give the precision you need

If you are going to resize the object multiple times, you have to take note of the object starting dimensions
(i.e. you can save them in some alt. value at start of frame) and use these values instead of 20/30 to perform the calculation above

3. Thank you. Wish there was a way to just set it directly at runtime, similar how you can set the position though. But this will do. Thanks again.

4. You can also refer to the width of the active dynamically if that is useful:

X scale to 234.0 / OWidth("Active 1")
Y scale to 967.0 / OHeight("Active 1")

Or use qualifiers to make it refer to many actives, etc

5. Hey PBarwick
it's been a while, cool to see you around!

Well said, I actually meant to write exactly that, but for some odd reason I ended up writing full figures,
and due to this my second sentence doesn't make much sense.

Now it should make sense: if you use OWidth and OHeight and want to resize the object multiple times,
you have to take note of the object starting dimensions (i.e. you can save them in some alt. value at start of frame)
and use these values instead of OWidth/OHeight to perform the calculation above
(otherwise the same expression for following scalings won't hold true,
since scale always refer to the graphic starting size while OWidth/OHeight refer to the object current size)

Also worth mentioning that Active Picture has that handy function: "set size",
where you can directly specify width and height, along with other cool features (dynamic hot spots!)
but of course missing all the animation features Active Object has.

oh well...
sorry for the confusion

6. Adding to what PBarwich said, OWidth changes depending on scale and rotation (lets say its a rectangle covering the entire object).

So if you scale an object more than twice this will happen (e.g. if object width is 32 at 1 scale):

Set X scale to 100.0 / OWidth ----> 3.125
OWidth changed to 100
Set X scale to 100.0 / OWidth ----> 1
OWidth changed to 32
... and so on, the object will flicker between scales.

Therefore, to easily get rid of this issue without using additional alterable values, you can set scale to 1 and then your scale method:
Set X scale to 1
OWidth changed to 32
Set X scale to 100.0 / Owidth ----> 3.125
OWidth changed to 100
... and so on, although, having twice as many scale actions is obviously a drawback.

7. Thanks @schrodinger good to see you're still active

P3D looks like it's come a huge way since then!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•