- 论坛徽章:
- 0
|
qt半透明
QFrame *frame = new QFrame();
QPixmap grabPixmap = QPixmap::grabWindow( frame->winId(), 20, 0, 100, 100 );
frame->setGeometry( 20, 20, 100, 100 );
frame->hide();
QPixmap pixmap = Resource::loadPixmap( "qpelogo" );
QImage image = pixmap.convertToImage();
//image.convertDepth( 32 );
image.setAlphaBuffer( true );
QImage bgImage = grabPixmap.convertToImage();
//bgImage.convertDepth( 32 );
bgImage.setAlphaBuffer( true );
double k = 0.5;
QRgb *rgbpos1 = image.colorTable();
QRgb *rgbpos2 = bgImage.colorTable();
for( int y = 0; y setBackgroundPixmap( grabPixmap );
frame->show();
#endif
引自: http://spaces.baidu.com/sszllx/blog/item/ab833a59ea98622f2934f001.html
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/69947/showart_1423501.html |
|