[Qt-interest] QPixmap

Gabriel M. Beddingfield gabrbedd at gmail.com
Thu Apr 8 07:50:10 CEST 2010



On Wed, 7 Apr 2010, Qrikg wrote:

> Which is the function similar to copyBlt in Qt4?

     Qt3's prototype:
     void QPixmap::copyBlt ( QPixmap * dst, int dx, int dy,
                             const QPixmap * src,
                             int sx, int sy, int sw, int sh )

There may be a better way... but this should work:

     void works_like_copyBlt( QPixmap& dst, int dx, int dy,
                              const QPixmap& src,
                              int sx, int sy, int sw, int sh )
     {
         QPainter painter(&dst);
         painter.drawPixmap( QRect( dx, dx, sw, sh ),
                             src,
                             QRect( sx, sy, sw, sh ) );
     }

-gabriel






More information about the Qt-interest-old mailing list