18-02-19 11:54 PM
30-04-21 08:01 AM
03-05-21 02:14 PM
public static byte[] ImageToByteArray(System.Drawing.Image imageIn)
{
using (var ms = new MemoryStream())
{
imageIn.Save(ms,imageIn.RawFormat);
return ms.ToArray();
}
}
BinaryOut = ImageToByteArray(ImageIn);
And in case anyone is trying this who isn't familiar with programming, be sure to add Namespace imports in the Initialise page > Properties > Code Options > Namespace Imports. For this, you should only have to add System.IO for the MemoryStream. No additions needed in External References.
Edit: Also in case it's not obvious, at this point, the Utility - File Management VBO's action 'Write Binary Data' can be used to write the binary data to the disk. Use the file extension such as .png in the name of the new file. And then the image should be viewable.
------------------------------
Dave Morris
Cano Ai
Atlanta, GA
------------------------------
04-05-21 08:15 AM
20-07-22 05:23 PM