"Transparent" selection behaviour


Normally if I have a bitmap with some part completely transparent it gets selected even if I click at the transparent area within bounds. I'm thinking if it's possible to change that behaviour so if I have an opaque object underneath it'll get selected instead of that  object on the top. For instance, GIMP presents such behaviour.

Here's an example: if I click where a red dot is (added in Paint just to indicate) I want the circle to get selected, not the bitmap on the top. I s this possible?