private int PointToPalette(int x, int y)
{
int col = -1;
int row = 0;
if (x >= 7 && x < 22)
col = 0;
else if (x >= 22 && x < 38)
col = 16;
else if (x >= 38 && x < 54)
col = 32;
else
return -1;
if (y < 60 || y > 60 + (16 * 15))
return -1;
row = (y - 60) / 15;
return col + row;
}