you should create the pens in the constructor and keep them around, instead of allocating / freeing GDI objects all the time.