Hello :
I obtain the QImage using the following code :
QBYteArray *b1 = socket->readAll();
ax->Load(b1);
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
NOw I have two questions
1) When I asked you how to pass from a QImage to a MythIMage you told me :
"Since MythImage subclasses QImage, you could use for example loadFromData() or fromData() and give it QImage::bis() as input "
¿ What does QImage::bis() mean ?
2) In JAVA I implement the following QTcpServer for sending Images :
ServerSocket servidor = new ServerSocket(4445);
Socket conexion = null;
salida = new Vector<ObjectOutputStream>();
// iniciar la captura desde la webcam
CaptureStream captureStream = iniciarCaptura();
conexion = servidor.accept();
salida.add(new ObjectOutputStream(conexion .getOutputStream()));
ServerSocket servidor = new ServerSocket(4445);
Socket conexion = null;
salida = new Vector<ObjectOutputStream>();
// iniciar la captura desde la webcam
CaptureStream captureStream = iniciarCaptura();
conexion = servidor.accept();
salida.add(new ObjectOutputStream(conexion .getOutputStream()));
To copy to clipboard, switch view to plain text mode
Where iniciarcaptura() is the following method :
private CaptureStream iniciarCaptura() throws IOException,
CaptureException
{
CaptureStream captureStream = null;
List list = system.getCaptureDeviceInfoList();
for (int i = 0; i < list.size(); ++i)
{
CaptureDeviceInfo info = (CaptureDeviceInfo)list.get(i);
ptureStream = system.openCaptureDeviceStream(info.getDeviceID());
List<VideoFormat> ls = captureStream.enumVideoFormats();
captureStream.setVideoFormat(ls.get(0));
captureStream.setObserver(new MyCaptureObserver());
break;
}
return captureStream;
}
private CaptureStream iniciarCaptura() throws IOException,
CaptureException
{
CaptureStream captureStream = null;
List list = system.getCaptureDeviceInfoList();
for (int i = 0; i < list.size(); ++i)
{
CaptureDeviceInfo info = (CaptureDeviceInfo)list.get(i);
ptureStream = system.openCaptureDeviceStream(info.getDeviceID());
List<VideoFormat> ls = captureStream.enumVideoFormats();
captureStream.setVideoFormat(ls.get(0));
captureStream.setObserver(new MyCaptureObserver());
break;
}
return captureStream;
}
To copy to clipboard, switch view to plain text mode
The question is
Is
QTcpSocket *socket (QTcpSocket *)sender();
QBYteArray *b1 = socket->readAll();
the best way of reading Images in the receptor ?
Thanks
Gorka
Bookmarks