• 8456阅读
  • 0回复

Qt 获取video frame 第一祯的图像方法 [复制链接]

上一主题 下一主题
离线zjhcool
 
只看楼主 倒序阅读 楼主  发表于: 2010-11-16

根据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重新编辑 ]
我的博客地址: http://newfaction.net
快速回复
限100 字节
 
上一个 下一个