<div><font face="courier new,monospace">hey,</font></div>
<div><font face="courier new,monospace">i have had a similar problem using the flex mx:canvas.</font></div>
<div><font face="courier new,monospace">i ended up solving the problem by simply using an</font></div>
<div><font face="courier new,monospace">mx:uicomponent instead. </font></div>
<div><font face="courier new,monospace"></font> </div>
<div><font face="courier new,monospace">good luck!<br clear="all">____ ___<br>\ \/ /___________ ____<br>.\ // __ \_ __ \/ _ \<br>./ \ ___/ | | \( <_> )<br>/___/\ \___ >__|---\____/<br>| \_/ \/ |<br>
| xero harrison |<br>| <a href="http://xero.nu">xero.nu</a>@<a href="http://gmail.com">gmail.com</a> |<br>| <a href="http://xero.nu">http://xero.nu</a> |<br>| <a href="http://fontvir.us">http://fontvir.us</a> |<br>
| <a href="http://hexarray.nu">http://hexarray.nu</a> | <br>| <a href="http://xero.owns.us">http://xero.owns.us</a> |<br>`---------------------' <br></font><br></div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>---------- Forwarded message ----------<br>From: ganaraj p r <<a href="mailto:ganarajpr@gmail.com">ganarajpr@gmail.com</a>><br>
To: <a href="mailto:papervision3d@osflash.org">papervision3d@osflash.org</a><br>Date: Wed, 3 Jun 2009 14:25:41 +0530<br>Subject: [Papervision3D] [OOT?] Measuring Width Height<br>
<div class="gmail_quote">Hi,
<div><br></div>
<div>I have been facing a strange problem lately. I define the sizes of containers in percentages..</div>
<div><br></div>
<div>say for example</div>
<div><br></div>
<div><mx:Canvas width="50%" height = "50%"></div>
<div>...</div>
<div>...</div>
<div>...</div>
<div></mx:Canvas></div>
<div><br></div>
<div>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. </div>
<div><br></div>
<div>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.</div>
<div><br></div>
<div>To do this.. I have tried accessing the width height of the canvas directly.. which return 0.</div>
<div>I have also tried the function getExplicitOrMeasuredWidth () and getExplicitOrMeasuredHeight() function. they too return 0.</div>
<div><br></div>
<div>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. </div>
<div><br></div>
<div>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 )</div>
<div><br></div>
<div>What I would like to know is .. is there anything I can do to get the current displayed size of the canvas, consistently?</div>
<div><br></div>
<div>Can someone help pls?</div>
<div><br></div>
<div>-- </div></div>Regards,<br>Ganaraj P R<br><br>_______________________________________________<br>Papervision3D mailing list<br><a href="mailto:Papervision3D@osflash.org">Papervision3D@osflash.org</a><br><a href="http://osflash.org/mailman/listinfo/papervision3d_osflash.org" target="_blank">http://osflash.org/mailman/listinfo/papervision3d_osflash.org</a><br>
<br></blockquote></div><br>