Import bitmap to blob from byte-array in C#.NET

John_ReinholdJohn_Reinhold Member Posts: 19
How do I import a bitmap into a blob-field from an automation that returns the bitmap as a byte-array? I need to do it from NAV4, not from C# by C/Front.

The blobfield.import only accepts filenames...

Of course I can save it in disk and then read it, but thats slow.

BTW: I use Visual Studio 2005
Regards,
John Reinhold

Comments

  • ara3nara3n Member Posts: 9,258
    I'm afraid that's the only way.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    You can create instream for the BLOB, but I am afraid that the stream is not compatible with C#... but you can try something around that...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jksjks Member Posts: 277
    Hi Kine,

    I also want to return bitmap in BYTE array to Navision but from COM.
    Can you please give me an example of how Navision side I can handle BYTE array using InStream/OutStream.


    Thanks for any help.
  • kinekine Member Posts: 12,562
    Sorry, I have no tips for you. I just know, that there are some posts about connecting Nav Streams with COM Streams.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • activ8activ8 Member Posts: 25
    You can export the bitmap with an xmlport en use a base64 to encode the bitmap into a bigtext node, then stream the xml file in .net object and decode it there.
    But that's much slower then writing the bitmap to a temp file.
Sign In or Register to comment.