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 (byte array, and then base64). But I need to know what dimensions the image created. (And as plus, if possible, resize it.)