Qt Image help (IP camera)
I'm having a problem with the images. I want to grab it from an IP camera to use it for processing. The problem is that the images I grabbed become thumbnails. Please help. This is my code:
QUrl page;
u开发者_Python百科i->setupUi(this);
m_view = new QWebView(this);
m_lbl = new QLabel(this);
m_lbl->setGeometry(100, 100, 840, 636);
connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));
page.setScheme("http");
page.setUserName("joharvie");
page.setPassword("tan");
page.setHost("10.4.2.3");
page.setPath("/snapshot.cgi");
m_view->load(page);
m_view->show();
QWebElement element = m_view->page()->mainFrame()->documentElement();
element = element.findFirst("img");
QPixmap pix(QSize(640, 480));//element.geometry().size());
QPainter painter(&pix);
element.render(&painter);
pix.save("target.jpg");
m_lbl->setPixmap(pix);
Are you sure the image in the page isn't a thumbnail that you click on for the full image? - (check the page source)
精彩评论