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,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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: 29th May 2012, 23:37
  2. Qwt & save as image
    By giostau in forum Qwt
    Replies: 1
    Last Post: 8th February 2012, 14:41
  3. QGraphicsView: Save as PNG without displaying View?
    By SixDegrees in forum Qt Programming
    Replies: 0
    Last Post: 8th October 2010, 22: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, 09: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, 01: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.