how to do edge detection?

I drew several rect one on top of another, and i want to do something to the topmost rect. How do I detect the edges of the topmost rect in the scene? I need to make a part of this rect transparent.

Not sure what you are trying to do here, once something is rendered you cannot change it, you simple redraw the scene again with the modified look.


does that mean i cannot read in the pixels from the scene and do something to it? I have an appplication using user interaction and on button click, depending on which is the topmost layer, I want to make that part transparent, that is what i wan to do.