Results 1 to 2 of 2

Thread: How could I do a copy from an image and make some changes??

  1. #1
    Join Date
    Nov 2009
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default How could I do a copy from an image and make some changes??

    I've loaded an image (QImage) in a frame by means of: frame->image.load(fileName);

    I would like to create a copy (if it's possible without saving it) from this image and make some changes in the image and show it again once it has been modified, but I don't know how to do it... because I use paintevent and I think that the paintevent repaint the image all the time, without represented the changes.

  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: How could I do a copy from an image and make some changes??

    I don't know what your "frame" is, but QImage::copy() returns a copy of the image. QImage class itself can be copied, so to have a copy of the image it is enough to have a copy of the object holding it.
    Qt Code:
    1. QImage img;
    2. img.load(...);
    3. QImage copyOfImg = img;
    To copy to clipboard, switch view to plain text mode 
    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. Problems with drawing image in paintEvent of QTreeView
    By Tito Serenti in forum Qt Programming
    Replies: 7
    Last Post: 24th December 2008, 23:25
  2. How to stretch background image used in brush-palette
    By Hookem in forum Qt Programming
    Replies: 5
    Last Post: 24th December 2008, 17:03
  3. Replies: 13
    Last Post: 18th February 2008, 00:20
  4. "sensitising" an image
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2006, 07:21
  5. reading in image from 24bit char*
    By cbeall1 in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2006, 00:09

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.