想到一个方法,还没试,谁知道更直接更好的告诉大家啊。
我想的方法是,先全屏幕截图(qtdemo中有截图的例子),然后在去图片中相应点的RGB值。
QPixmap QPixmap::grabWidget ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) [static]
QImage QPixmap::toImage () const
int QImage::pixelIndex ( const QPoint & position ) const
QRgb QImage::color ( int i ) const
QColor QColor::fromRgb ( QRgb rgb ) [static]
[ 此帖被wxyao在2011-04-14 23:35重新编辑 ]