If you post your code, the readers might see a point, which can be improved.
A solution might be to create a 2D matrix with same number of elements as the figure has pixels. Let the values be 0 outside the pixels and n for the n.th button. Then use the CurrentPoint in units pixels as index of this matrix. So you need 1 test to check all buttons.