2

如何创建 QML 这样的画布,并在该画布上附加 XOverlay 视频对象?

Java:
final Canvas canvas = new Canvas(); 
canvas.setPreferredSize(new Dimension(200, 200)); 
XOverlay.wrap(video).setWindowID(canvas);

C++
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/QmlTest1/main.qml"));

    // set the window no border, to do full screen live VIDEO
    viewer.setWindowFlags(
                            Qt::CustomizeWindowHint |
                            Qt::FramelessWindowHint
    );
    viewer.showExpanded();

    return app.exec();
}

我的参考:

http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeexamples.html

http://www.scriptol.com/programming/qml.php

4

1 回答 1

2

QML 中的视频播放可以通过 Qt Mobility 的 Video 元素完成: http: //doc.qt.nokia.com/qtmobility-1.2/qml-video.html

于 2011-05-24T08:21:17.207 回答