Qt画图时有时需要从源文件的图片中截取某一部分置入目标区域,这时使用
void QPainter::drawImage(const QRect & target, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor)重载方法
英文文档:This is an overloaded function.
Draws the rectangular portion source of the given image into the target rectangle in the paint device.
Note: The image is scaled to fit the rectangle, if both the image and rectangle size disagree.
将image中处于source位置(矩形)的部分画面画入target(矩形)中,若大小不一致,则自适应大小。