0
私はスロットマシン用に3枚の画像を比較しようとしていますが、問題は何も起こりませんが、画像は何かに比べて得られないようです。私は、画像一覧の画像を有し、それらは、ランダムに選択されているが、imagebox1はチェリーbettextboxが習慣=勝者C#画像をIfステートメントと比較する方法
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Bitmap apple = Properties.Resources.Apple;
Bitmap cherries = Properties.Resources.Cherries;
Bitmap orange = Properties.Resources.Orange;
private void spinButton_Click(object sender, EventArgs e)
{
Random rand = new Random();
int pic = rand.Next(0, images.Images.Count);
int pic2 = rand.Next(0, images.Images.Count);
int pic3 = rand.Next(0, images.Images.Count);
pictureBox1.Image = images.Images[(pic)];
pictureBox2.Image = images.Images[(pic2)];
pictureBox3.Image = images.Images[(pic3)];
if (pictureBox1.Image == cherries)
{
betTextBox.Text = "Winner";
}
これは私のためにやったようですが、今はif文でさまざまな勝利条件を得ることができます。 – Sovias