Results 1 to 5 of 5

Thread: image processing

  1. #1
    Join Date
    Jun 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default image processing

    hello,

    Is any way to thread images? I mean, I have load an image on a button. This image has a red zone that i don't need and I would like to erase that black area and stay with the desired image.

    Is any way to turn this area(the red one) transparent?

    My code is the following one:

    QPixmap buttonImage("images/down.bmp");
    QPixmap button2Image("images/up.bmp");

    QIcon Icon;
    Icon.addPixmap ( buttonImage, QIcon::Normal, QIcon::Off );
    Icon.addPixmap ( button2Image, QIcon::Normal, QIcon::On );

    QPushButton *Button = new QPushButton(&widget1);
    Button->setIcon(Icon);
    Button->setIconSize(QSize(120,80));
    Button->setCheckable(true);
    Button->setGeometry(0,0,100,78);
    Button->move(295,320);


    thanks in advance!!
    Attached Images Attached Images
    Last edited by IRON_MAN; 18th November 2009 at 11:04.

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: image processing

    I think you need to use QPixmap::setMaskThen the question is : how to compute it from your loaded image from pixel value, knowing that pixel manipulation is done in a QImage?
    But since your file is hard coded, you mask may be hard coded too.

  3. #3
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: image processing

    Can't you load the image into an image editor and paint transparency over the red area?

  4. #4
    Join Date
    Jun 2009
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: image processing

    no I can't, because the image has to be checkable.

  5. #5
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: image processing


Similar Threads

  1. Image processing
    By NicNac in forum Newbie
    Replies: 25
    Last Post: 2nd November 2008, 11:05
  2. Replies: 0
    Last Post: 26th October 2008, 14:56
  3. Image processing via matrix
    By jones.79 in forum Qt Programming
    Replies: 10
    Last Post: 22nd September 2008, 01:42
  4. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 16:36
  5. Image Processing using Qt
    By danielperaza in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2008, 19:15

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.