Each your pad has about 500 x 500 = 250 000 pixmaps + (something else)
Depends of your video mode each pixel can be 1,2, 4 bytes long
In total you are creating
250 000 x 400 = 100 Mbytes (200 Mbytes or 400 Mbytes) long objects (at
least)
How large is your RAM ? What is your video mode ?
Valery