2
I have the following code:
var binario = _documentoWord.Content.EnhMetaFileBits;
string img64Bytes = "";
var base64 = Convert.ToBase64String(binario, 0, binario.Length);
byte[] imageBytesBase64 = Convert.FromBase64String(base64);
MemoryStream ms64 = new MemoryStream(imageBytesBase64);
Image img = Image.FromStream(ms64);
using (MemoryStream ms = new MemoryStream())
{
img.Save(ms, ImageFormat.Png);
byte[] imageBytes = ms.ToArray();
img64Bytes = Convert.ToBase64String(imageBytes);
}
var url = "<img src='data:image/png;base64," + img64Bytes + "' />";
In this code I transform a word file into an image (array of bytes, and then Base64). But I need to know which dimensions of the created image. (And as a plus, if possible, resize it).