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 ?
Printable View
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:
Code:
QNetworkAccessManager * manager; QNetworkReply * reply = manager->get(QNetworkRequest(yourFile->url()));
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?
Code:
char *data = NULL; http_fetch(urlpath,&data) pixmap.loadFromData((const uchar *)data,sizeof(data));
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.Code:
int len = http_fetch(urlpath,&data) pixmap.loadFromData((const uchar *)data, len);