How to do betting in C# with roulette (with a betting table)?

How to do betting in C# with roulette (with a betting table)?

做个少女永远怀春 发布于 2021-11-28 字数 531 浏览 794 回复 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

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨后咖啡店 2022-06-07 1 楼

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.