HasImage
Inhalt
[
Ausblenden
]ImageData.HasImage property
RückgabenWAHR
wenn die Form Bildbytes enthält oder ein Bild verlinkt.
public bool HasImage { get; }
Beispiele
Zeigt, wie alle Bilder aus einem Dokument im Dateisystem gespeichert werden.
Document imgSourceDoc = new Document(MyDir + "Images.docx");
// Formen mit gesetztem „HasImage“-Flag speichern und zeigen alle Bilder des Dokuments an.
Shape[] shapesWithImages = imgSourceDoc.GetChildNodes(NodeType.Shape, true).Cast<Shape>()
.Where(s => s.HasImage).ToArray();
// Gehen Sie jede Form durch und speichern Sie ihr Bild.
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);
}
Siehe auch
- class ImageData
- namensraum Aspose.Words.Drawing
- Montage Aspose.Words