原地址不清楚,从网上随便找到的,做一下记录
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