Converting image send via webserver

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)

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 ?

@ WE - You need to pass an actual formatted bitmap file to the constructor. You can use conversion function in GHI.Utilities.Bitmaps.ConvertToFile. There is an issue with it in the current SDK though, see:

Hi John,

To make the camera work again could you give me some pointers what i have to change in the camera driver

@ WE - My post in the thread I linked walks you through fixing the camera.