Hi could someone help me, how I can set contrast, transparency, brightness, etc. of my QGraphicsItem or QPixmap or QImage, which are used as bruch of QGraphicsItem.
Thanks a lot
Printable View
Hi could someone help me, how I can set contrast, transparency, brightness, etc. of my QGraphicsItem or QPixmap or QImage, which are used as bruch of QGraphicsItem.
Thanks a lot
nobody gives me hint? please
Transparency is easy,,, just use QColor(r,g,b,a); a is for aplha, meaning how much transparent pixel shud be.
As for brightness, contrast,,, there was some example, probably on Qt Labs -> Dojo . am not able to find the link,, but will post if i find it. You can search for it meanwhile , may be u find it :)
for transparency and QColor(r,g,b,a); I thought, that QColor is usable only for colors. So if it is usable for QPixmap and QImage too, It is great :) I can try it
And If you find this link you will be my God :)
Sorry about this, I looked up Qimage and found it uses QRgb in setPixel :(Quote:
Transparency is easy,,, just use QColor(r,g,b,a); a is for aplha, meaning how much transparent pixel shud be.
However transparency is still easy... you can use QGraphicsItem::setOpacity :)
but QGraphicsItem::setOpacity it is not, only QPainter::setOpacity and I am trying QImage::colorTable now, but I dont know, if it is OK :eek:
I am in this situation...
but anything changes. It is some mistake in this code or in another? thanks for reactionCode:
QVector<QRgb> rgbvector = image.colorTable(); QVector<QColor> colors(0); QVector<QRgb> rgbvector2(0); foreach(QRgb pixel, rgbvector){ colors.append(pixel); } color.setAlpha(value); rgbvector2.append(color.rgba()); } image.setColorTable(rgbvector2);