Advertisement
Yo_Mb

Yo_21Mb

Oct 30th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. private static PictureBox tile = new PictureBox();
  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.BackColor = System.Drawing.Color.Transparent;
  11. tile.Image = Image.FromFile("../../Screenshot (189).png");
  12. tile.Location = new Point((i * 40) , (j * 40));
  13. tile.Size = new Size(40, 40);
  14. tile.SizeMode = PictureBoxSizeMode.StretchImage;
  15. tile.Visible = true;
  16. tile.Update();
  17. Console.WriteLine(i + " " + j);
  18. }
  19. }
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. and in form it is
  28. private void Form1_Load(object sender, EventArgs e)
  29. {
  30. Map map1 = new Map(3, 3);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement