C# 如何使用Aspose.word获取word文档中所有卸载的图像
如何获取Aspose.word生成的word文档中所有卸载的图像。像这样的图像 我已经解决了我的问题。我把我的答案贴在这里,也许对其他人有帮助C# 如何使用Aspose.word获取word文档中所有卸载的图像,c#,.net,asp.net-mvc-4,aspose,C#,.net,Asp.net Mvc 4,Aspose,如何获取Aspose.word生成的word文档中所有卸载的图像。像这样的图像 我已经解决了我的问题。我把我的答案贴在这里,也许对其他人有帮助 var doc = new Document(); var shapeCollection = doc.GetChildNodes(Word.NodeType.Shape, true); // getting all images from Word document.
var doc = new Document();
var shapeCollection = doc.GetChildNodes(Word.NodeType.Shape, true);
// getting all images from Word document.
foreach (Shape shape in shapeCollection)
{
if (shape.ShapeType == ShapeType.Image)
{
//Unloaded image alwasy have 924 imagebytes
if (shape.ImageData.ImageBytes.Length == 924)
{
shape.Width = 72.0;
shape.Height = 72.0;
}
}
}
这确实是一个很大的帮助。