(image, dw, dh)
| 118 | |
| 119 | |
| 120 | def createPixmapFromNinePatchImage(image, dw, dh): |
| 121 | w = dw |
| 122 | h = dh |
| 123 | if w < image.width() or h < image.height(): # shrink |
| 124 | w = max(image.width(), w) |
| 125 | h = max(image.height(), h) |
| 126 | pm1 = resize9patch(image, w, h) |
| 127 | if pm1.isNull(): |
| 128 | return QPixmap() |
| 129 | pm2 = QPixmap(dw, dh) |
| 130 | pm2.fill(Qt.transparent) |
| 131 | pr = QPainter(pm2) |
| 132 | pr.setRenderHint(QPainter.Antialiasing) |
| 133 | pr.setRenderHint(QPainter.SmoothPixmapTransform) |
| 134 | pr.drawPixmap(0, 0, dw, dh, pm1, 0, 0, w, h) |
| 135 | return pm2 |
| 136 | else: |
| 137 | return resize9patch(image, dw, dh) |
nothing calls this directly
no test coverage detected