Draw image to a grid based on mouse click

What I am wanting to achieve is for my image to be drawn at coordinates divisible by 24 only. Let’s say I click at 170, 80 I need to find the closest coords (x AND y) that are divisible by 24 and draw the image there.

I can’t think of a suitable method to do this, so if anyone can provide some guidance for me that would be much appreciated.

~Shazer2

Couldn’t you just make the coordinates doubles, then divide them by 24, cast to an int, then multiply by 24?

-Nathan

I should have wrote on the thread that I got it sorted. Thanks anyway, StonePickaxes.

~Shazer2