如何创建 QML 这样的 Canvas ,并在该 Canvas 上附加 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
最佳答案
QML 中的视频播放可以通过 Qt Mobility 的视频元素完成: http://doc.qt.nokia.com/qtmobility-1.2/qml-video.html
关于c++ - 我如何在我的 C++ 代码中创建 QML Canvas 并在其上附加视频?比如 Java Canvas 我可以,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6007535/