[Laszlo-user] Image scaling proportionally

Mike Pence mike.pence at gmail.com
Wed Apr 12 14:58:32 EDT 2006

Here is what I need to do: I need to load some large images, then
scale them down, proportionally, to fit within a part of the screen.
This seems like awfully common need, so I am surprised that the answer
is so difficult to find.  Maybe I am just not looking in the right

Here is what I have done: I went to this excellent site
(http://secretartofscience.com/blog/?p=6) and tried the example that
uses the aspect ratio property. No dice. I am on Laszlo 3.2. Here is
as simple as I can make it:

<canvas bgcolor="black" width="800" >
 	<view name="demoview" clip="true" resource="2.jpg"

That works, of course. But as soon as I try to do any kind of math
with those values, say:

${unstretchedHeight * 0.2}

No image shows up. What am I missing?

Mike Pence

More information about the Laszlo-user mailing list