HasImage
Contenuti
[
Nascondere
]ImageData.HasImage property
RestituisceVERO
se la forma ha byte di immagine o collega un’immagine.
public bool HasImage { get; }
Esempi
Mostra come salvare tutte le immagini da un documento al file system.
Document imgSourceDoc = new Document(MyDir + "Images.docx");
// Le forme con il flag "HasImage" impostato memorizzano e visualizzano tutte le immagini del documento.
Shape[] shapesWithImages = imgSourceDoc.GetChildNodes(NodeType.Shape, true).Cast<Shape>()
.Where(s => s.HasImage).ToArray();
// Esamina ogni forma e salva la relativa immagine.
for (int shapeIndex = 0; shapeIndex < shapesWithImages.Length; ++shapeIndex)
{
ImageData imageData = shapesWithImages[shapeIndex].ImageData;
using (FileStream fileStream = File.Create(ArtifactsDir + $"Drawing.SaveAllImages.{shapeIndex + 1}.{imageData.ImageType}"))
imageData.Save(fileStream);
}
Guarda anche
- class ImageData
- spazio dei nomi Aspose.Words.Drawing
- assemblea Aspose.Words