All pastes #436120 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-12 11:11 UTC
rendered paste body
 public partial class GameForm : Form
    {
        Form parentF = null;
        Bitmap bitmap = null;
        Graphics bitmapGraphics = null;
        SolidBrush blackSBrush = null;
        int gameRectW = 0;
        int gameRectH = 0;

        Map map = null;

        public GameForm(Form parentF)
        {
            this.parentF = parentF;

            InitializeComponent();
            InitializePaintbox();
            InitializateMap();
            Repaint();

            parentF.Visible = false;
        }

        private void InitializePaintbox() {
            gameRectW = 760;
            bitmap = new Bitmap(gameRectW, gameRectH);
            bitmapGraphics = Graphics.FromImage(bitmap);
            blackSBrush = new SolidBrush(Color.Black);
        }

        private void Repaint() {
            
            bitmapGraphics.FillRectangle(blackSBrush, 0, 0, gameRectW, gameRectH);
            map.Repaint(bitmapGraphics);
            gamePictureBox.BackgroundImage = bitmap;
        }

        private void InitializateMap() {
            map = new Map(8,8,60);
        }

        private void GameForm_FormClosing(object sender, FormClosingEventArgs e){
            parentF.Visible = true;
        }
    }