Advertisement
GeeckoDev

connect4

Oct 14th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace ConnectFourGUI
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void Form1_Paint(object sender, PaintEventArgs e)
  21.         {
  22.             Bitmap bm = new Bitmap("C:\\logo.png");
  23.  
  24.             for (int i = 0; i < 6; i++)
  25.             {
  26.                 for (int j = 0; j < 7; j++)
  27.                 {
  28.                     e.Graphics.DrawImage(bm, new Rectangle(j * bm.Width, i * bm.Height, ClientRectangle.Width / 7, ClientRectangle.Height / 6));
  29.                 }
  30.             }
  31.         }
  32.  
  33.         private void Form1_ClientSizeChanged(object sender, EventArgs e)
  34.         {
  35.             this.Invalidate();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement