12345678910111213141516171819202122 |
- #include "papereditpainter.h"
- #include "qpainter.h"
- CPaperEditPainter::CPaperEditPainter(QWidget *parent)
- : QWidget(parent)
- {
- m_bgimage = nullptr;
- }
- CPaperEditPainter::~CPaperEditPainter()
- {
- }
- void CPaperEditPainter::paintEvent(QPaintEvent *e)
- {
- QRect rc(this->rect());
- QPainter painter(this);
- painter.setRenderHint(QPainter::Antialiasing);
- painter.translate(m_offset->x(), m_offset->y());
- painter.scale(*m_room, *m_room);
- painter.drawImage(QPoint(0, 0), *m_bgimage);
- }
|