C++ (Qt) QImage *img=new QImage(100,100,QImage::Format_RGB32); QPainter *p=new QPainter(img); p->fillRect(QRect(0,0,100,100),QBrush(Qt::white,Qt::SolidPattern)); p->drawLine(0,0,100,100); img->save("c:\\1.jpg","JPG"); delete p; delete img;