[Papervision3D] [OOT?] Measuring Width Height
ganaraj p r
ganarajpr at gmail.com
Wed Jun 3 01:55:41 PDT 2009
Hi,
I have been facing a strange problem lately. I define the sizes of
containers in percentages..
say for example
<mx:Canvas width="50%" height = "50%">
...
...
...
</mx:Canvas>
Now inside this I would want to measure the size of the canvas as it is
currently because I have an image.. which might be much bigger than this
canvas and I want to scale it down to fit this canvas.
So to do that I will have to measure the size of the canvas and figure out
what values to use for scaleX and scaleY for the inside image so that it
fits into the canvas.
To do this.. I have tried accessing the width height of the canvas
directly.. which return 0.
I have also tried the function getExplicitOrMeasuredWidth ()
and getExplicitOrMeasuredHeight() function. they too return 0.
I have tried canvas.getBounds( canvas.stage); and worked with the rect that
is returned.. In some cases this works. But not in all cases.
The issue is this does seems to work fine for 1-2 states but doesnt work for
a third one ( the value returned is wrong )
What I would like to know is .. is there anything I can do to get the
current displayed size of the canvas, consistently?
Can someone help pls?
--
Regards,
Ganaraj P R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090603/9dc6b9a7/attachment-0001.html>
More information about the Papervision3D
mailing list