implement a function for painting images
implement support for rich text printing