Options

DotNet Memory Stream to NAV Blob Field

kush10kush10 Member Posts: 3
I am trying to write a dotnet memory stream to a NAV Blob field. But the below code isnt working.

Does anyone have any experience in this area? much appreciated.

bitmap := barcodeWriter.Write(BitMatrix);


bitmapMemoryStream := bitmapMemoryStream.MemoryStream;
bitmap.Save(bitmapMemoryStream,bitmapEncoder.Bmp);

// I am able to save the bitmap to the MemoryStream, but unable to write it in to the blob. all stream variables are set to run on client Yes

CALCFIELDS(VerificationQRCode);
VerificationQRCode.CREATEOUTSTREAM(outstr);
outstr.WRITE(bitmapMemoryStream);

Answers

  • Options
    ftorneroftornero Member Posts: 522
    Hello @kush10,

    First of all you don't need to use a memory stream in this case, you can use a InStream var.

    And later you can move to the OutStream var like this:
    COPYSTREAM(outstr, instr);
    

    Any way you can do the same with your memory stream var
    COPYSTREAM(outstr, bitmapMemoryStream);
    

    Regards
Sign In or Register to comment.