Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static PictureBox tile = new PictureBox();
- public Map(int map_x, int map_y)
- {
- this.map_map = new int[map_x, map_y];
- for (int i = 0; i < map_map.GetLength(0); i++)
- {
- for (int j = 0; j < map_map.GetLength(1); j++)
- {
- tile.BackColor = System.Drawing.Color.Transparent;
- tile.Image = Image.FromFile("../../Screenshot (189).png");
- tile.Location = new Point((i * 40) , (j * 40));
- tile.Size = new Size(40, 40);
- tile.SizeMode = PictureBoxSizeMode.StretchImage;
- tile.Visible = true;
- tile.Update();
- Console.WriteLine(i + " " + j);
- }
- }
- }
- and in form it is
- private void Form1_Load(object sender, EventArgs e)
- {
- Map map1 = new Map(3, 3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement