locked
How to save a Signature captured using InkManager in byte[] to be read in Crystal Report.

    Question

  •  Hi.

     I'm developing an enterprise app in Xaml where I capture a signature using the InkManager control in windows 8.1, the user can print the document from the device just fine with the signature, but the document is sync back to the server and from Dynamics GP the user can print the document but the signature is not in a valid format.

    I use the next code to save it into a database field in byte[] but the format is not recognized by the process in the crystal reports.

     public async Task<byte[]> SaveToByte()
            {
                if (_NoteInkManager == null) return null;
    
                 using (var stream = new InMemoryRandomAccessStream())
                 {
                     await _NoteInkManager.SaveAsync(stream);
                     await stream.FlushAsync();
                     stream.Seek(0);
                     byte[] nbytes = new byte[stream.Size];
                     IBuffer buffer = nbytes.AsBuffer();
                     await stream.ReadAsync(buffer, (uint)stream.Size, InputStreamOptions.None);
                     return nbytes;
                 }
            }

     I'm looking several solution but none of I found work in my application.

    I appreciated any help thanks. 

    Monday, February 16, 2015 4:37 PM

Answers

  • Is the problem that you need another format or that the stream isn't being rendered correctly? If you save the buffer to disk can you view it as a GIF and read it back in with InkManager.LoadAsync?

    InkManager.SaveAsync will write out an ISF file, which is a GIF with ink information in its metadata. 

    If you need another format you should be able to read the image itself (but not the stroke info) with a BitmapDecoder and then transcode with with a BitmapEncoder.

    --Rob

    Monday, February 16, 2015 6:17 PM
    Owner