【问题标题】:How to change coordinate system on Pixmap如何在 Pixmap 上更改坐标系
【发布时间】:2013-05-05 18:39:11
【问题描述】:

谁知道如何从左上角坐标系移动到默认坐标系,其中 X/Y 轴从 QPixmap/Qimage 上的左下角开始(就像我们总是画它们一样)

【问题讨论】:

  • 您是否已经阅读了 QPainter 关于 coordinate transforms 的文档?
  • @Roku 是的,但我不明白我该怎么做。

标签: qt drawing geometry qimage qpixmap


【解决方案1】:

解决办法如下:

QMatrix m;
m.translate(0,size.height());
m.scale(1,-1);
QPainter painter;
painter.begin(&pic);
painter.setMatrix(m);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-20
    相关资源
    最近更新 更多