本文整理汇总了C++中QPixmap::setOptimization方法的典型用法代码示例。如果您正苦于以下问题:C++ QPixmap::setOptimization方法的具体用法?C++ QPixmap::setOptimization怎么用?C++ QPixmap::setOptimization使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPixmap
的用法示例。
在下文中一共展示了QPixmap::setOptimization方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rotate
void rotate()
{
int i;
const int w = 64;
const int h = 64;
QImage image( w, h, 8, 128 ); // create image
for ( i=0; i<128; i++ ) // build color table
image.setColor( i, qRgb(i,0,0) );
for ( int y=0; y<h; y++ ) { // set image pixels
uchar *p = image.scanLine(y);
for ( int x=0; x<w; x++ )
*p++ = (x+y)%128;
}
QPixmap pm;
pm = image; // convert image to pixmap
pm.setOptimization( QPixmap::BestOptim ); // rotation will be faster
QWidget *d = QApplication::desktop(); // w = desktop widget
for ( i=0; i<=360; i += 2 ) {
QWMatrix m;
m.rotate( i ); // rotate coordinate system
QPixmap rpm = pm.xForm( m ); // rpm = rotated pixmap
d->setBackgroundPixmap( rpm ); // set desktop pixmap
d->update(); // repaint desktop
}
}
示例2: MyPaint
void MyPaint(NBioBSPRollDemo_Widget* pWidget)
{
QPixmap Spm;
Spm = pWidget->m_RollImage;
Spm.setOptimization(QPixmap::BestOptim);
QWMatrix Sm;
Sm.scale((double)IMAGE_FRAME_WIDTH/(double)pWidget->m_DeviceInfo0.ImageWidth,
(double)IMAGE_FRAME_HEIGHT/(double)pWidget->m_DeviceInfo0.ImageHeight);
QPixmap Srpm = Spm.xForm(Sm);
bitBlt(pWidget->m_frmRoll, 0, 0, &Srpm);
}