Dear all ,
I want draw images on screen, but images on server and there is a ethernet connection between, server and client.I tried to u http client program to take pictures but i couldnt achieve this. What do you suggest me ?
Dear all ,
I want draw images on screen, but images on server and there is a ethernet connection between, server and client.I tried to u http client program to take pictures but i couldnt achieve this. What do you suggest me ?
Take a look at : QNetworkAccessManager
Try something like that:
Qt Code:
QNetworkAccessManager * manager; QNetworkReply * reply = manager->get(QNetworkRequest(yourFile->url()));To copy to clipboard, switch view to plain text mode
Dear Friend,
I have install my linux, http_fetcher program, and it have a function http_fetch(),
it loads the file to memory from the server, so i could load the picture to memory, and the last step I tried to paint them to the label. But Qpixmap::loadFromData( ) didnt work. Do you have any suggestion?
Qt Code:
char *data = NULL; http_fetch(urlpath,&data) pixmap.loadFromData((const uchar *)data,sizeof(data));To copy to clipboard, switch view to plain text mode
Last edited by anafor2004; 24th August 2009 at 10:41.
It seems like this fetch is a blocking function.
Please check the return value of loadFromData().
And check the length of image data after fetch to make sure that fetcher is fetching right.![]()
sizeof(data) will always return the size of a pointer. You need to use the return value of http_fetch:
On another note, using a blocking function in your GUI thread is probably not a good idea.Qt Code:
int len = http_fetch(urlpath,&data) pixmap.loadFromData((const uchar *)data, len);To copy to clipboard, switch view to plain text mode
anafor2004 (25th August 2009)
Bookmarks