Results 1 to 4 of 4

Thread: Accessing alpha channel of QImage directly

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Initially transparent QImage

    And what is wrong with using QImage::setPixel()?
    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.


  2. #2
    Join Date
    Nov 2008
    Posts
    38
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default

    setPixel refers to RGB, not RGBA

    Oh, and I forgot to say, the long term solution for me is to paint alpha channels directly via a brush, but this refers to QPainters and not QImages! I'm doing it per-pixel in a QImage at the moment as a short term hack

    Thinking about it, what I'm after is a kind of "eraser" brush, photoshop-style, and I want this to be at the level of a QBrush, not pixel hacking.
    Last edited by wysota; 19th March 2009 at 16:28.

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

    Default Re: Accessing alpha channel of QImage directly

    Quote Originally Posted by spraff View Post
    setPixel refers to RGB, not RGBA
    No, it referrs to QRgb which may also contain the alpha value.
    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. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. Replies: 12
    Last Post: 7th September 2011, 16:37
  3. How can I create a transparent image with QImage?
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 28th January 2009, 15:06
  4. Multiple QPainters on QImage
    By fire in forum Qt Programming
    Replies: 3
    Last Post: 14th August 2008, 13:10
  5. leaveEvent on transparent area issue
    By nooky59 in forum Qt Programming
    Replies: 10
    Last Post: 8th January 2008, 13:22

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.