×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    21

    Question Update color of an image

    Hi, I am making Image Editor App.I want to add QColorDialog for update Color of image. I have set image on QLabel.

    This is my code that run fine but not able to change color of image.

    void ImageViewer::updateColor()
    {
    QColor color = QColorDialog::getColor(Qt::white,ui->imageHolder);

    if(color.isValid())
    {
    // QPixmap pixmap = *ui->imageHolder->pixmap();
    // pixmap.fill(color);** //this is also not change color of image
    ui->imageHolder->setPalette(QPalette(color));
    ui->imageHolder->setAutoFillBackground(true);
    ui->imageHolder->update();
    }
    }

    Any idea?

    Thanks...

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Update color of an image

    i guess this would only affect the background, you probably want to redraw all of your image with this color.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    21

    Re: Update color of an image

    you r right i want redraw picture with this color... what i should do??

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Update color of an image

    fill should do it.

Similar Threads

  1. convert color image to gray
    By topocheng in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-08-05, 07:17
  2. Convert a color image in a black/white image... HELP!
    By xirc85 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2007-10-18, 14:17
  3. How to set the color of the focus for an image
    By biskero in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2007-02-26, 16:59
  4. image color depth
    By ffunus in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2004-05-03, 07:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×