Hi all,
I am trying to send an image made from the camera via webserver class to a windows client application but every image i send and try to convert is generating an exception which says Parameter is not valid.
the code to send convert the bitmap to picture is this :
private GT.Picture _currentPicture;
private void CameraOnBitmapStreamed(Camera sender, Bitmap bitmap)
{
_currentPicture = new GT.Picture(bitmap.GetBitmap(), GT.Picture.PictureEncoding.BMP);
}
The webevent code looks like this :
void getImageEvent_WebEventReceived(string path, WebServer.HttpMethod method, Responder responder)
{
responder.Respond(_currentPicture);
}
and this is the code i use to try to convert the bytes received on the client side:
var data = response.RawBytes;
MemoryStream memoryStream = new MemoryStream(data);
var image = Image.FromStream(memoryStream);
what am i doing wrong here ?