Results 1 to 4 of 4

Thread: how to put a Pixmap in a qwtplot?

  1. #1
    Join Date
    Jul 2012
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question how to put a Pixmap in a qwtplot?

    hello

    I wonder how I can put a QPixmap in a QwtPlot, this can be done?

    I just need to zoom to an area of ​​the QPixmap. And with the function of QwtPlot Zoomer is easy.

    QwtPlotZoomer* zoomer = new MyZoomer(canvas());
    zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
    Qt::RightButton, Qt::ControlModifier);
    zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
    Qt::RightButton);

    if not can I have another way to zoom to QPixmap?

    thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,160
    Thanked 829 Times in 778 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to put a Pixmap in a qwtplot?

    How is your pixmap related to plot coordinates ?

    Uwe

  3. #3
    Join Date
    Jul 2012
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to put a Pixmap in a qwtplot?

    I do not understand your question.

    I have a QPixmap that contains an image. is something like this

    image.JPG

    and I need to make zoom.

    for this reason I put it in a QwtPlot, to use the function:

    QwtPlotZoomer* zoomer = new MyZoomer(canvas());
    zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
    Qt::RightButton, Qt::ControlModifier);
    zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
    Qt::RightButton);

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,160
    Thanked 829 Times in 778 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to put a Pixmap in a qwtplot?

    When the pixmap is unrelated to any plot coordinates QwtPlot is not the right solution.

    Instead put your Pixmap on a QLabel. You can use a QwtPicker ( works with any type of widget ) if you want to use Qwt classes, but using a QRubberband should do it as well. The rest is about translating the selected rectangle into QPixmap/QImage operations.

    Uwe

  5. The following user says thank you to Uwe for this useful post:

    jackajack01 (25th July 2012)

Similar Threads

  1. Replies: 1
    Last Post: 19th April 2011, 11:17
  2. pixmap
    By odee2004 in forum Qt Programming
    Replies: 3
    Last Post: 28th August 2009, 17:16
  3. Replies: 6
    Last Post: 14th May 2009, 12:02
  4. Pixmap scaling
    By yellowmat in forum Newbie
    Replies: 3
    Last Post: 4th January 2007, 16:01
  5. tablewidget and pixmap
    By magoo in forum Qt Programming
    Replies: 7
    Last Post: 8th November 2006, 21:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.