IsImage

ShapeBase.IsImage property

RestituisceVERO se questa forma è una forma immagine.

public bool IsImage { get; }

Esempi

Mostra come aprire un documento HTML con immagini da un flusso utilizzando un URI di base.

using (Stream stream = File.OpenRead(MyDir + "Document.html"))
{
    // Passare l'URI della cartella base durante il caricamento
    // in modo che sia possibile trovare tutte le immagini con URI relativi nel documento HTML.
    LoadOptions loadOptions = new LoadOptions();
    loadOptions.BaseUri = ImageDir;

    Document doc = new Document(stream, loadOptions);

    // Verifica che la prima forma del documento contenga un'immagine valida.
    Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);

    Assert.IsTrue(shape.IsImage);
    Assert.IsNotNull(shape.ImageData.ImageBytes);
    Assert.AreEqual(32.0, ConvertUtil.PointToPixel(shape.Width), 0.01);
    Assert.AreEqual(32.0, ConvertUtil.PointToPixel(shape.Height), 0.01);
}

Guarda anche