I am in this situation...
QImage image
= item
->brush
().
textureImage();
QVector<QRgb> rgbvector = image.colorTable();
QVector<QColor> colors(0);
QVector<QRgb> rgbvector2(0);
foreach(QRgb pixel, rgbvector){
colors.append(pixel);
}
foreach
(QColor color, colors
){ color.setAlpha(value);
rgbvector2.append(color.rgba());
}
image.setColorTable(rgbvector2);
item
->setBrush
(QBrush(image
));
QImage image = item->brush().textureImage();
QVector<QRgb> rgbvector = image.colorTable();
QVector<QColor> colors(0);
QVector<QRgb> rgbvector2(0);
foreach(QRgb pixel, rgbvector){
colors.append(pixel);
}
foreach(QColor color, colors){
color.setAlpha(value);
rgbvector2.append(color.rgba());
}
image.setColorTable(rgbvector2);
item->setBrush(QBrush(image));
To copy to clipboard, switch view to plain text mode
but anything changes. It is some mistake in this code or in another? thanks for reaction
Bookmarks