40 QPainter bufferPainter( &
buffer );
41 bufferPainter.setClipping(
false);
42 bufferPainter.fillRect(
buffer.rect(), backgroundBrush() );
46 { bufferPainter.drawImage( QPoint(0,0), pixmap()->convertToImage() ); }
49 bitBlt(
this, e->rect().x(), e->rect().y(),
51 e->rect().x(), e->rect().y(),
52 e->rect().width(), e->rect().height() );
70 QImage alpha = newImage.createAlphaMask();
72 for(y=0; y<newImage.height(); y++)
74 for(x=0; x<newImage.width(); x++)
76 if(alpha.isNull() || qRed(alpha.pixel(x,y)) == 0)
78 QRgb rgb = newImage.pixel(x,y);
79 int gray = qGray(rgb);
81 gray = (int) (alpha*gray+(1-alpha)*255);
82 rgb = qRgb( gray, gray, gray );
83 newImage.setPixel( x, y, rgb );
88 newPixmap.convertFromImage( newImage );
89 QLabel::setPixmap( newPixmap );
139 QImage alpha = newImage.createAlphaMask();
141 for(y=0; y<newImage.height(); y++)
143 for(x=0; x<newImage.width(); x++)
145 if(alpha.isNull() || qRed(alpha.pixel(x,y)) == 0)
147 QRgb rgb = newImage.pixel(x,y);
148 int r = (int) (0.5*qRed(rgb));
149 int g = (int) (0.5*qGreen(rgb));
150 int b = (int) (0.5*qBlue(rgb));
151 rgb = qRgb( r, g,
b );
152 newImage.setPixel( x, y, rgb );
157 newPixmap.convertFromImage( newImage );
158 QLabel::setPixmap( newPixmap );
168 QImage alpha = newImage.createAlphaMask();
170 for(y=0; y<newImage.height(); y++)
172 for(x=0; x<newImage.width(); x++)
174 if(alpha.isNull() || qRed(alpha.pixel(x,y)) == 0)
176 QRgb rgb = newImage.pixel(x,y);
177 int r = (int) (0.8*qRed(rgb));
178 int g = (int) (0.8*qGreen(rgb));
179 int b = (int) (0.8*qBlue(rgb));
180 rgb = qRgba( r, g,
b, qAlpha(rgb) );
181 newImage.setPixel( x, y, rgb );
186 newPixmap.convertFromImage( newImage );
187 QLabel::setPixmap( newPixmap );