Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: getColorBoundsRect() doesn't work in Player 9

  1. #1

    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?

    HTML Code:
    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

  2. #2
    That would imply it was a bug fixed in FP10

  3. #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.
    Vectorization Package - Convert raster to vector at runtime in the Flash Player!

    Collision Detection Kit - Shape-based collision detection package for AS3.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012