0
我嘗試從資源中讀取圖像。Qt創建者:從資源中讀取圖像
的Qt:5.9.1和OpenCV:3.2
我的代碼是:
// Set initial screen
QImage image;
cv::Mat src = cv::imread(":/images/initialScreen.png");
image = ImageFormat::Mat2QImage(src);
videoFrameLabel->setPixmap(QPixmap::fromImage(image));
而且我的文件:
我的.pro文件:
QT += core gui
QT += widgets
QT += gui
CONFIG += c++14
QT += multimedia multimediawidgets
...
SOURCES += \
main.cpp \
mainwindow.cpp \
imageformat.cpp
HEADERS += \
mainwindow.h \
imageformat.h \
blob.h
FORMS += \
mainwindow.ui
INCLUDEPATH += C:\opencv\build\include
LIBS += C:\opencv-build\bin\libopencv_video320.dll
...
LIBS += C:\opencv-build\bin\libopencv_imgcodecs320.dll
DISTFILES +=
RESOURCES += \
rsc.qrc
它不起作用,我在哪裏犯錯?謝謝 !
哦!你是對的,非常感謝你! –