#pragma once #include #include "ZxObjRect.h" class I_PLOTCURVE_T_EXPORT ZxObjImage : public ZxObjRect { Q_OBJECT ZX_DECLARE_DYNAMIC public: ZxObjImage(); ZxObjImage(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY); ~ZxObjImage(); virtual void init(const QString& sName, ZxSubAxisX* pAxisX, ZxSubAxisY* pAxisY); // 击中 virtual bool hitTest(const QPointF& pt); // 击中后,ButtonUp后的处理 // pt1:鼠标Down点,pt2:鼠标Up点 virtual bool runMove(const QPointF& pt1, const QPointF& pt2); // 封装 virtual void initTools(); protected: // 设置图元对象的属性标志 virtual void initFlags(); protected: public: virtual void paintBack(QPainter* painter, const ZxPaintParam& param); virtual void drawImage(QPainter* painter, QRectF rt, QString sPath, int nAlpha = 255); virtual void _drawImage(QPainter* painter, QRectF rt, QImage& img, int nAlpha); virtual void onSerialize(ZxSerializer* ser); virtual void onDeserialize(ZxSerializer* ser); virtual void fillPtyPano(IxPtyPano* sheet); virtual void onLeftDoubleClick(const QPointF& pt); public: // 图片 QString getImgPath(); virtual void setImgPath(QString s); protected: QString m_sImgPath; //图片 };