C#
1class Game1 : Form 2{ 3 public static void Main() 4 { 5 Application.Run(new Game1()); 6 } 7 public Game1() 8 { 9 this.Text = "Game"; 10 this.BackColor = Color.FromArgb(255, 255, 255); 11 this.WindowState = FormWindowState.Maximized; 12 13 this.Width = 1366; 14 this.Height = 768; 15 16 PictureBox start = new PictureBox(); 17 start.Image = Image.FromFile("d:\\start.png"); 18 start.Width = 338; 19 start.Height = 149; 20 start.Top = (this.Height - start.Height) / 2; 21 start.Left = (this.Width - start.Width) / 2; 22 23 start.Parent = this; 24 25 start.Click += new EventHandler(start_Click); 26 } 27 public void start_Click(object sender, EventArgs e) 28 { 29 Graphics gr = start.CreateGraphics(); 30 PictureBox stage1 = new PictureBox(); 31 stage1.Image = Image.FromFile("d:\\stage1.jpg"); 32 stage1.Width = 1920; 33 stage1.Height = 1200; 34 stage1.Parent = this; 35 } 36}
stage(stage1.jpg)の画像の上にstart(start.png)の画像がかぶります
どうすればstage("stage1.jpg)の画像だけ表示できますか!?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/02 08:38