Results 1 to 3 of 3
April 13th, 2009, 10:39 PM #155Registered User
getColorBoundsRect() doesn't work in Player 9
Is there any reason why getColorBoundsRect() of the BitmapData Class would work in Flash player 10 but not in 9?
letterText.text ="H"; var textBitmapData:BitmapData = new BitmapData(letterText.width, letterText.height, true, 0x00000000); textBitmapData.draw(letterText); var bounds:Rectangle = textBitmapData.getColorBoundsRect(0xFF000000, 0x00000000, false); trace(bounds); // (x=0, y=0, w=0, h=0) in Flash Player 9 trace(bounds); // (x=7, y=5, w=88, h=91) in Flash Player 10
April 14th, 2009, 09:20 AM #2
April 14th, 2009, 10:42 AM #3
I came across this bug at one point. I'd wager a guess that in your example your text field's antialiasing is set to advanced. If you haven't specified the antialiasing, but have your fonts embedded, then it should be set to advanced.
Your example actually works just fine if you set the text field's antiAliasType property to anything other than AntiAliasType.ADVANCED. So in the future, when you want to grab the bitmapdata from a text field, be sure to (at least temporarily) set its antiAliasType to AntiAliasType.NORMAL first.