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 at the cost of the inability to access pixel data. You can freely convert between the two types, but bear in mind that on some platforms, this might be an expensive operation. Always consider which class serves your particular situation better. If you...