CanHaveImage

ShapeBase.CanHaveImage property

RestituisceVERO se il tipo di forma consente alla forma di avere un’immagine.

public bool CanHaveImage { get; }

Osservazioni

Sebbene Microsoft Word abbia un tipo di forma speciale per le immagini, sembra che nei documenti di Microsoft Word qualsiasi forma , ad eccezione di una forma di gruppo, possa avere un’immagine, pertanto questa proprietà restituisceVERO per tutte le forme tranneGroupShape.

Esempi

Mostra come inserire e ruotare un’immagine.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Inserisci una forma con un'immagine.
Shape shape = builder.InsertImage(ImageDir + "Logo.jpg");
Assert.True(shape.CanHaveImage);
Assert.True(shape.HasImage);

// Ruota l'immagine di 45 gradi in senso orario.
shape.Rotation = 45;

doc.Save(ArtifactsDir + "Shape.Rotate.docx");

Guarda anche