I have a .NET SDK edge application written in C#. I am using the GetNamedPropertyValuesVTQ call to return a set of properties from a THING. One of the properties is an image. Casting to IMAGEPRIMATIVE or byte shows a length of 0 in debug mode. Double question set is:
1. How can you convert an ImagePrimative to a C# image to be able to persist the image to client folder.
2. Is there an alternative way to download the image property into an edge application (C#)?
The cast seems to fail (return 0) because the image returned from the InfoTable is encoded in base64.
First decoding and then casting on the result may work (untested). directly casting does not work because there might not be a constructor / operator for the target type you're casting to that accepts base64 encoded data . You should then be able to save the type (for example if you choose a byte array) to a file, which will represent the ImagePrimitive.
Please let me know if you have any questions.