Results 1 to 2 of 2

Thread: Painting one Image from another Image with paint brush

  1. #1
    Join Date
    Dec 2010
    Posts
    14
    Thanks
    1

    Default Painting one Image from another Image with paint brush

    Hi Folks,

    I want to create a paint brush , which instead of using a single color or color pattern , uses pixels from another image. Is there a way to do it efficiently?...

    In my current setting , I am doing painting on a QImage with paint brush. But I also want a brush which can recover the original image if the region under brush is painted with some color. In short I want an unpaint brush.

    thanks and regards

    Avanindra Singh

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

    Default Re: Painting one Image from another Image with paint brush

    You need two images. One is the original image which you do not touch, just use for compositing. The other image starts with being fully transparent. There you use QPainter::drawImage() to paint parts of some other (third? first?) image over it. Erasing your actions is quite easy because you just draw with a Clear compositing mode on it again. Finally you compose the output image by using the "Painter's Algorithm" -- first draw the original image and then draw the other image over it.
    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. The following user says thank you to wysota for this useful post:

    avanindra (21st July 2012)

Similar Threads

  1. How can we paint image on slider?
    By pratik041 in forum Qt Programming
    Replies: 5
    Last Post: 9th November 2011, 19:17
  2. How to Display/Paint raw image data.
    By vinaykusta in forum Qt Programming
    Replies: 5
    Last Post: 12th October 2011, 15:01
  3. How to stretch background image used in brush-palette
    By Hookem in forum Qt Programming
    Replies: 5
    Last Post: 24th December 2008, 18:03
  4. Painting an image on QItemDelegates
    By sprek in forum Qt Programming
    Replies: 4
    Last Post: 12th June 2008, 01:00
  5. Painter greyscale, image quality paint-brush!
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 22nd March 2007, 21:32

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.