[Papervision3D] [OOT?] Measuring Width Height

xero xero.nu at gmail.com
Wed Jun 3 06:08:26 PDT 2009


hey,
i have had a similar problem using the flex mx:canvas.
i ended up solving the problem by simply using an
mx:uicomponent instead.

good luck!
____  ___
\   \/  /___________  ____
.\     // __ \_  __ \/ _  \
./     \  ___/ | | \( <_>  )
/___/\  \___  >__|---\____/
|     \_/   \/        |
| xero harrison       |
| xero.nu at gmail.com   |
| http://xero.nu      |
| http://fontvir.us   |
| http://hexarray.nu  |
| http://xero.owns.us |
`---------------------'


> ---------- Forwarded message ----------
> From: ganaraj p r <ganarajpr at gmail.com>
> To: papervision3d at osflash.org
> Date: Wed, 3 Jun 2009 14:25:41 +0530
> Subject: [Papervision3D] [OOT?] Measuring Width Height
> 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
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20090603/7302c9c2/attachment.html>


More information about the Papervision3D mailing list