QPixmap has a copy method that accepts QRect. can I cut part of an image based on QPainterPath?

  • one
    What should be the result of a cut operation - Cerbo

1 answer 1

Well, like so:

QPixmap copyPath(const QPixmap & src, const QPainterPath & area) { QPixmap result(src.size()); QPainter canvas(&result); canvas.setClipPath(area); canvas.drawPixmap(0,0,src); return result; }