Источник:
http://palleagermark.blogspot.com/20...rom-image.html
==============
Here's how you can create a 64-bit encoded string from an image in AX:
static void Job4(Args _args)
{
System.Drawing.Image image;
Str string;
System.Byte[] byteArray;
System.IO.MemoryStream memoryStream;
;
// Load the file
image = System.Drawing.Image::FromFile(@"C:\sandbox\test.tif");
// Convert the file to a byte array
memoryStream = new System.IO.MemoryStream();
image.Save(memoryStream, System.Drawing.Imaging.ImageFormat::get_Tiff());
// Create the 64-bit encoded string
string = System.Convert::ToBase64String(memoryStream.ToArray());
// Save it again, to a new image (just for fun or test of you want)
AifUtil::saveBase64ToFile(@"C:\sandbox\test1.tif", string);
}
Источник:
http://palleagermark.blogspot.com/20...rom-image.html