Qt Snippet: Draw into QPixmap

Draw inside QPixmap can be made using QPainter object. Basically you have to pass to QPainter the pointer to your QPixmap (already created with fixed size) and you can draw inside as the same of window area painting.

QPixmap MyPixamp(QSize(32,32));
QPainter Painter;

// Here paint inside QPixmap
Painter.setPen(QPen(QBrush(Qt::red), 1, Qt::DashLine));
// ...


Popular posts from this blog

Access GPIO from Linux user space

Launch an app from Android shell terminal

Android: adb push and read-only file system error