Hello , I am implementing a QTCP Client for receiving images . I have the following code :
void NetworkControl::aceptar_conexiones()
{
quint16 port = 4445;
soket->connectToHOst(direc,port)
connect(soket,SIGNAL(readyRead()),this,SLOT(leercaracter()))
}
void NetworkControl::leerCaracter()
{
QBYteArray *b1 = socket->readAll();
ax->Load(b1);
}
void NetworkControl::aceptar_conexiones()
{
QTcpSocket *soket = new QTcpSocket(this);
const QString direc ="xxxxxxxxxx";
quint16 port = 4445;
soket->connectToHOst(direc,port)
connect(soket,SIGNAL(readyRead()),this,SLOT(leercaracter()))
}
void NetworkControl::leerCaracter()
{
QTcpSocket *socket (QTcpSocket *)sender();
QBYteArray *b1 = socket->readAll();
QImage ax= new QImage("xxxxxxxx");
ax->Load(b1);
}
To copy to clipboard, switch view to plain text mode
I would like to obtain a QImage from the QByteArray obtained by socket->readAll(). What would be the best way for obtaining it ?
I use the following code :
QBYteArray *b1 = socket->readAll();
ax->Load(b1);
QTcpSocket *socket (QTcpSocket *)sender();
QBYteArray *b1 = socket->readAll();
QImage ax= new QImage("/home/aux/real.jpg");
ax->Load(b1);
To copy to clipboard, switch view to plain text mode
Any suggestion ?
Thanks.
Gorka
I use the following
Hello , I am trying to obtain a const QIMage from a QByteArray. Does any body know how to obtain it ?
Thanks
Gorka
Hello
I am trying to transmit and represent video streaming from a video WebCam.
The receiver is based on a QTCPSocket , which obtains all the images the following way :
void NetworkControl::leercaracter()
{
QTcpSocket *socket = ( QTcpSocket * )sender()
QByteArray nbytes2 = socket->readAll();
}
I would like to obtain a const QImage from nbytes_2. What is the best way ?
I use the following way but it does not work :
const QImage *im1 = new QImage("xxxxxxxxx");
im1 ->loadfromData(nbytes2);
This code does not compile . Can you propose me any other code ? I need it for creating a MythImage anf MythUIIMage.
Thanks
Gorka
Bookmarks