[转]QT 显示视频

原地址不清楚,从网上随便找到的,做一下记录

QPainter has a method called drawImage. You can do something like the

following in a subclass of QWidget:

void VideoWidget::paintEvent()

{

//Get

the current frame and size data...

//Passing QImage

QImage frame(frameDataUCharPtr, frameWidth, frameHeight.

QImage::Format_RBG32 );

QPainter painter(this);

painter.drawImage(rect(), frame);

}

Under Qtopia

you can use QDirectPainter to write directly to framebuffer

memory and get

some faster access for drawing frames. You will have to

do the color conversions yourself to get

the frame into your

framebuffer's color model.

--Justin

posted @ 2010-12-28 19:41  网络小虫  阅读(2739)  评论(0编辑  收藏  举报