Results 1 to 5 of 5

Thread: QImage copy

  1. #1
    Join Date
    Oct 2009
    Posts
    70

    Default QImage copy

    Hi,

    I have a QImage with an existing uchar * buffer.

    If I make:

    Qt Code:
    1. qimage = qimage.scaled(..);
    To copy to clipboard, switch view to plain text mode 

    the qimage buffer is the same, or I need to delete the previous buffer ?

    thanks

  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: QImage copy

    QImage::scaled() makes a deep copy of the image. The new image will have its own (new) buffer.
    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.


  3. #3
    Join Date
    Oct 2009
    Posts
    70

    Default Re: QImage copy

    Yes, but the new buffer of the scaled image, it is managed by the qimage or I need to delete it after the image destruction?

  4. #4
    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: QImage copy

    It is managed by QImage instance.
    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.


  5. #5
    Join Date
    Jun 2010
    Location
    Hangzhou, China
    Posts
    10
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QImage copy

    you need not delete it manually.

Similar Threads

  1. Copy row(s) from QTableWidget
    By allensr in forum Qt Programming
    Replies: 10
    Last Post: 1st February 2017, 08:59
  2. Copy a log file
    By fortyhideout12 in forum Qt Programming
    Replies: 2
    Last Post: 15th August 2009, 08:05
  3. copy and paste
    By hubipet in forum Qt Tools
    Replies: 1
    Last Post: 17th July 2009, 06:19
  4. What's faster: QPixmap-to-QImage or QImage-to-QPixmap
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2006, 17:11
  5. Replies: 3
    Last Post: 15th March 2006, 11:44

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.