With the operators << and >>. Or QImage::bits() function