First let me say that I am a novice at using graphics. I am writing an implementation of Conway's Game of Life Wiki Ref.. Basically you have a world of cells that can be dead or alive based on the rules given in the reference.
My implementation:
- I use a picturebox to show the state of the world. The image is large enough to hold a world of 269 x 269 with each cell being 3 x 3.
- when the world is created I create a bitmap and graphics(_G) object of the appropriate size
- the bitmap is initially filled to the dead cell color
- To draw individual cells I use
- The next state of the world is displayed withCode:_G.FillRectangle(Brush, New Rectangle(x * _BlockSize, y * _BlockSize, _BlockSize, _BlockSize))
- After the initial pass I only draw cells that have changed, and process those that may have changed.Code:BackGroundBM = theWorld.NextTick() 'NextTick returns the worlds bitmap PictureBox1.Image = BackGroundBM
My problem is that the drawing seems slow. Any help is appreciated.




Reply With Quote
