Question

Is there a way to resize the canvas of a QPixmap, similar to how an image editor does it - by padding and clipping the image as necessary, but not scaling it?

If not, I assume I should create a new (compatible) QPixmap, and use QPainter::drawPixmap() to place the original image appropriately.

Was it helpful?

Solution

No, there is no such option. You need to create another pixmap and use drawPixmap as you said.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top