Hello,
I need to scale a polygon.
write the following
QTransform trans;
trans=trans.scale(1.5,1.5);
path.addPolygon(qpf2);
QPolygonF qpf=QPolygonF(QPolygon(4,points));
QTransform trans;
trans=trans.scale(1.5,1.5);
QPolygonF qpf2=trans.map(qpf);
path.addPolygon(qpf2);
To copy to clipboard, switch view to plain text mode
for the points:
static const int points[8] = {
10, 80,
20, 10,
80, 30,
90, 70
};
static const int points[8] = {
10, 80,
20, 10,
80, 30,
90, 70
};
To copy to clipboard, switch view to plain text mode
it generates
---15,120--
---30,15--
---120,45--
---135,105--
thus it moves slightly too.
is there a way to scale from center?
Bookmarks