根据
Qt 4.6
官方文档中以下描述:
[pre] void VideoWidgetSurface::paint(
QPainter *painter)
{
if (currentFrame.map(QAbstractVideoBuffer::ReadOnly)) {
const QTransform oldTransform = painter->transform();
if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) {
painter->scale(1, -1);
painter->translate(0, -widget->height());
}
QImage image(
currentFrame.bits(),
currentFrame.width(),
currentFrame.height(),
currentFrame.bytesPerLine(),
imageFormat);
painter->drawImage(targetRect, image, sourceRect);
painter->setTransform(oldTransform);
currentFrame.unmap();
}
....
...
标签: frame,
QImage,
Qt,
QVideoFrame,
video 本文链接: Qt 获取video frame 第一祯的图像方法 版权所有: Venus, 转载请注明来源Venus并保留链接地址!
}
相关文章[ 此帖被zjhcool在2010-11-17 10:52重新编辑 ]