Advertisement
Yo_Mb

Yo_21Mb

Oct 30th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. private static PictureBox[,] tile = new PictureBox[100,100];
  2.  
  3. public Map(int map_x, int map_y)
  4. {
  5. this.map_map = new int[map_x, map_y];
  6. for (int i = 0; i < map_map.GetLength(0); i++)
  7. {
  8. for (int j = 0; j < map_map.GetLength(1); j++)
  9. {
  10. tile[i, j] = new PictureBox();
  11. tile[i, j].BackColor = System.Drawing.Color.Red;
  12. tile[i, j].Image = Image.FromFile("../../Screenshot (189).png");
  13. tile[i, j].Location = new Point((i * 40) , (j * 40));
  14. tile[i, j].Size = new Size(40, 40);
  15. tile[i, j].SizeMode = PictureBoxSizeMode.StretchImage;
  16. tile[i, j].Show();
  17. tile[i, j].Update();
  18. Console.WriteLine(i + " " + j);
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement