저는 비디오 프로세싱 프로젝트를 진행하고 있습니다. 디버깅을 위해 특정 폭의 QLabel에 일부 프레임의 ROI를 추가해야합니다. 라벨에 서브 프레임을 추가해야합니다 .... 그 일을위한 아이디어가 있습니까 ??Qlabel (Qt)에 이미지 추가
답변
QLayout (horizintal, Vertical e t.c) 및 QLabel을 사용할 수 있습니다. 필요에 따라 QLabel을 동적으로 만들고 레이아웃에 추가하십시오. 이걸로 U는 원하는만큼 사진을 추가 할 수 있습니다. 희망이 있습니다.
#include <QtGui/QApplication>
#include <QLabel>
#include <QImage>
#include <QLayout>
#include <QMainWindow>
#include <QStringList>
#include <QDebug>
#include <QScrollArea>
//This assumes that the pictures are in the application's Current working directory
//Four pictures used with names 1.png,2.png,3.png and 4.png respectively
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow w;
QWidget *central = new QWidget(&w);
w.setCentralWidget(central);
QLayout *test_layout = new QVBoxLayout(central);
QStringList file_names;
file_names <<"1"<<"2"<<"3"<<"4";
foreach(QString pics, file_names){
QLabel* imagethings = new QLabel();
QImage image(QString("%1.png").arg(pics));//QImage's Constructor takes a file path
imagethings->setPixmap(QPixmap::fromImage(image));
test_layout->addWidget(imagethings);//append the new image
}
// remove Space as a result of widget Margin(see link for Box Model below)
central->setStyleSheet("QLabel{border:0px; margin:0px; padding:0px;}");
central->layout()->setContentsMargins(0,0,0,0);//remove Spac as a result of Layout Margins
//Please try to take advantage of Qt's Detailed Documentatio that Comes with the SDK
w.show();
return a.exec();
}
http://doc.qt.digia.com/qt/stylesheet-customizing.html -box 모델 http://doc.qt.digia.com/qt/stylesheet-reference.html -Stylesheet 참조 스타일 시트 더 나은
사실 Qlabel 상자를 만들었습니다. 나는 이미지가 caputured를 보여주는 것을 지원할 수 있는지 알아야하고 이미지가 치수를 초과하면 아래쪽으로 추가되고 finnaly 스크롤됩니다. –
나는 대답을 편집 했으므로, 그것이 당신의 요구에 부합되기를 바랍니다. –
- 1. QLabel 모서리에 QSizeGrip 추가
- 2. QT에 다른 컴파일러 추가
- 3. mySQL을 Qt에 이미지 연결 및로드
- 4. Qt에 사용자 정의 글꼴 추가
- 5. retranslateUi() QLabel 텍스트를 지움
- 6. Qt QLabel 창으로 크기 조정 이미지
- 7. Qt : QScrollArea 내에 이미지 (QLabel) 표시
- 8. 생성 된 Qt에 Makefile을 추가/추가하십시오.
- 9. Qt에 외부 패키지를 추가 할 수 없습니다.
- 10. QLabel 이미지보기 천천히
- 11. Transpaprent QLabel
- 12. qlabel 센터링
- 13. QMenu의 QLabel
- 14. QLabel 회전
- 15. QScrollArea의 QLabel
- 16. Qt QLabel PaintEvent 무시하기
- 17. Qt에 카운터 기능을 표시하는 방법
- 18. Qt는 동적 QLabel 생성
- 19. Qt의 QPushButton에 이미지 추가
- 20. QLabel 포지셔닝의 어려움
- 21. QGridLayout에서 QLabel 늘리기
- 22. QLabel :: setPixmap() 및 QScrollArea :: setWidget()
- 23. JPEG 이미지가 Qt에 표시되지 않습니다.
- 24. QLabel 최대화 방법
- 25. PyQt는 업데이트 QLabel
- 26. Qt는 QLabel 테두리 사이즈
- 27. QLabel 텍스트 크기 조정시
- 28. Qt는 QLabel 기본 텍스트
- 29. 듣기 QLabel 만들기
- 30. PyQt5 QLabel 오류 PyQT4에서
투자 수익 (ROI)을 분별하는 당신은 링크를 통해 확인 할 수 있습니까? 투자 수익? –
관심 영역 –