Skip to content
Advertisement

How to crop an image using QPainterPath without saving rest of image

I have a QPainterPath and I want to crop an image which is QPixmap. This code worked for me but I want to use PyQt5 builtin functionality like mask without numpy

JavaScript

Advertisement

Answer

One possible way to replace mask is to use the setClipPath() method of QPainter:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement