Results 1 to 8 of 8

Thread: QImage setPixel does not set alpha value

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QImage setPixel does not set alpha value

    Hi,

    I am trying to change the pixel value of image by using setPixel() method.
    It is changing the RGB values successfully but not changing the Alpha value.
    It always shows value 255.

    The code is like this

    QImage image = pixmap->tpImage();
    int width = image.width();
    int height = image.height();
    for( i = 0 ; i < height; i++)
    {
    for( j = 0; j < width; j++ )
    {
    image.setPixel(j,i, QColor(0,0,0,0).rgb()) ;
    }
    }

    Thanks in advance
    ~Sanjay
    Last edited by sanjayshelke; 19th February 2009 at 14:12. Reason: spelling error

Similar Threads

  1. Replies: 12
    Last Post: 7th September 2011, 16:37
  2. [SOLVED] QImage setPixel alpha issue
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2008, 15:06
  3. Multiple QPainters on QImage
    By fire in forum Qt Programming
    Replies: 3
    Last Post: 14th August 2008, 13:10
  4. OGLWidget + setPixel = slow
    By JimJey in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2008, 20:08
  5. QShared
    By sabeesh in forum Qt Programming
    Replies: 11
    Last Post: 11th October 2007, 12:40

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
  •  
Qt is a trademark of The Qt Company.