8 Replies Latest reply on Jan 7, 2009 10:33 PM by Rothrock

    Detect multiple areas of transparency in an image?

    gunforhire
      I need to detect multiple areas of transparency in an image, and colour them if they intersect a list of co-ordinates AND are surrounded by solid colour.
      I've tried a few methods but I'm stumped for the moment.
      getColorBoundsRect won't work as it just sees all the transparencies as a bounding area. I've also tried ColorMatrixFilter and Threshold among other methods.

      paletteMap might work, but I'd need something that checked if they intersected and where surrounded by colour, and floodFill sounds promising but it would need to be updated as the user drew on the stage.
      Checking each pixels colour also may work but I'm not sure how to go about checking that the pixels are surrounded by another colour on all sides.

      Any ideas?
      I've searched all over but I can't find any examples similar to what I need to do.
      Time is running out....