views:

429

answers:

1

What I have right now is a "Betting Table", a picture box I have placed on my form. What I'm trying to do is make it so that when you click on one of the squares, it prints another image, that of a poker chip, on the respective spot on the board, that part isn't difficult, just time consuming. What I want to know is how I can make this thing read where the images have been placed. If I can, it's an easy task to make it do the math for the betting, again, that is just time consuming. Thank you in advance.

~T-Fox

+2  A: 

You'll could create an array in the background that represents the segments on your image.

When a user clicks on a segment on the image, you could update the relevant array[i] with a value to represent a chip or number of chips assigned to that segment.

You could also use this array for redrawing/repainting your image if you needed to refresh it.

Edit

Just to follow up, you'd probably need to create some sort of correlation table between defined areas on your image and the array. Creating a rectangle based on origin and width/height mapped against an array index.

So if a user clicks on a segment in the Image, you can take the cursor X,Y value, compare to see what rectangle it's in, and then update that array value.

Eoin Campbell