Working with images

Qt has two classes for handling images. The first one is QImage, more tailored toward direct pixel manipulation. You can check the size of the image or check and modify the color of each pixel. You can convert the image into a different internal representation (say from 8-bit color map to full 32-bit color with a premultiplied alpha channel). This type, however, is not that fit for rendering. For that, we have a different class called QPixmap. The difference between the two classes is that QImage is always kept in the application memory, while QPixmap can only be a handle to a resource that may reside in the graphics card memory or on a remote X server. Its main advantage over QImage is that it can be rendered very quickly ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.