Results 1 to 2 of 2

Thread: Save QGraphicsView Image completely

  1. #1
    Join Date
    Jul 2012
    Location
    India
    Posts
    33
    Thanks
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Save QGraphicsView Image completely

    I am creating photo editing tool using QGraphicsView. i can load image using

    m_scene.addPixmap(QPixmap(m_strLoadImagePath));

    then how I can save this image completely

    I tried this code

    QGraphicsView* view = new QGraphicsView(scene,this);
    QString fileName = "file_name.png";
    QPixmap pixMap = QPixmap::grabWidget(view);
    pixMap.save(fileName);


    But it is saving only the display portion of the image in graphicsView including the scrollbar . How I can save the image completely and without showing the QGrraphicsView objects scrollbars

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Save QGraphicsView Image completely

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 4
    Last Post: 30th May 2012, 00:37
  2. Qwt & save as image
    By giostau in forum Qwt
    Replies: 1
    Last Post: 8th February 2012, 15:41
  3. QGraphicsView: Save as PNG without displaying View?
    By SixDegrees in forum Qt Programming
    Replies: 0
    Last Post: 8th October 2010, 23:56
  4. How to save an image (png) into a xml file
    By richardander in forum Qt Programming
    Replies: 8
    Last Post: 9th October 2009, 10:57
  5. is it possible to save a webpage as an image?
    By billconan in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2008, 02:08

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.