/**************************************************************************** ** $Id: qt/showimg.h 3.3.8 edited Jan 11 14:37 $ ** ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. ** ** This file is part of an example program for Qt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ #ifndef SHOWIMG_H #define SHOWIMG_H #include #include #include class QLabel; class ImageViewer : public QMainWindow { Q_OBJECT public: ImageViewer( QWidget *parent=0, Qt::WindowFlags wFlags=0 ); ~ImageViewer(); bool loadImage( const QString& ); protected: void paintEvent( QPaintEvent * ); void resizeEvent( QResizeEvent * ); void mousePressEvent( QMouseEvent * ); void mouseReleaseEvent( QMouseEvent * ); void mouseMoveEvent( QMouseEvent * ); private: void scale(); bool convertEvent( QMouseEvent* e, int& x, int& y ); QString filename; QImage image; // the loaded image QPixmap pm; // the converted pixmap QPixmap pmScaled; // the scaled pixmap void updateStatus(); bool reconvertImage(); int pickx, picky; int clickx, clicky; void ClearResult(); void updateResults(); bool m_drawSegment; bool m_initialized; int m_firstPoint; QLabel *results; imt::IMTResult m_result; private slots: void openFile(); }; #endif // SHOWIMG_H