I have an image I create that is normalized to 8-bit (0->255) stored as quint8*. I pass this to QImage and it works well. Is there anyway to set the black pixels to transparent without using libpng to set the tRNS?
I have an image I create that is normalized to 8-bit (0->255) stored as quint8*. I pass this to QImage and it works well. Is there anyway to set the black pixels to transparent without using libpng to set the tRNS?
Convert the QImage to one of the formats which support alpha channel (example QImage::Format_ARGB32) , then set the black color pixels with alpha color.
Read about
QImage::convertToFormat();
QImage:: pixelColor();
QImage::setPixelColor();
When you know how to do it then you may do it wrong.
When you don't know how to do it then it is not that you may do it wrong but you may not do it right.
Bookmarks