Drawing off screen
There are a number of reasons why you might like to draw offscreen: you might want to compose a collection of images and show them one after another (this is called double-buffering, which you can do to avoid screen painting flicker when you draw onscreen), or write a program that generates image files directly.
As I mentioned in the previous section, Qt provides several classes for offscreen drawing, each with different advantages and disadvantages. These classes are QImage, QPixmap, QBitmap, and QPicture. Under normal circumstances, you need to choose between QImage and QPixmap.
Tip
QImage is the class best-suited for general-purpose drawing where you're interested in loading the image from or saving the image to a file. If ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access