Search Results for

    Show / Hide Table of Contents

    Interface IImage

    Inherited Members
    IGraphic.Height
    IGraphic.Position
    IGraphic.Width
    IGraphic.Angle
    IContentElement.Remove()
    IContentElement.Replace(IContentElement)
    IContentElement.Parent
    IContentElement.Status
    Namespace: IronPPT.Interfaces
    Assembly: IronPPT.dll
    Syntax
    public interface IImage : IGraphic, IContentElement

    IImage is the picture object you work through whenever a slide carries a bitmap. It models one image placed on a presentation: where it sits, how big it is, what it is called, and the raw bytes behind it. A developer reaches for this contract when reading or repositioning the pictures already on a slide, or when adjusting an image that was just added.

    You rarely construct it. An image arrives through the graphics surface of a slide or shape, which hands back an IImage after a picture is added or when the existing pictures are enumerated. From there the same object is the handle for every later edit, so adding, measuring, and resizing all run against one reference rather than a fresh lookup each time. Coding against the interface also keeps the picture-handling code independent of how the bitmap was first supplied, whether from a file path, a stream, or a bitmap already in memory.

    The everyday members fall into a few groups. Name and Id identify the image, Type reports its ImageType, and ImageData exposes the underlying IImageContent. Geometry is inherited from IGraphic: Width, Height, Position, and Angle place and rotate the picture. For content changes, LoadFromFile and LoadFromStream swap the source bytes in place, Resize takes a new width and height in pixels, and Clone returns a copy as an IContentElement. The concrete implementor in IronPPT is Image, so a variable typed as IImage and one typed as Image describe the same object.

    foreach (IImage image in slide.Images)
    {
        image.Resize(400, 300);
        image.Name = "logo";
    }

    The add image example places a picture on a slide, the manage image how-to walks through editing one that is already there, and the manage slide how-to covers reaching the slide that holds it.

    Properties

    FrameShape

    Declaration
    Nullable<ShapeType> FrameShape { get; set; }
    Property Value
    Type Description
    System.Nullable<ShapeType>

    Id

    Declaration
    string Id { get; set; }
    Property Value
    Type Description
    System.String

    ImageData

    Declaration
    IImageContent ImageData { get; }
    Property Value
    Type Description
    IImageContent

    Index

    Declaration
    int Index { get; set; }
    Property Value
    Type Description
    System.Int32

    Name

    Declaration
    string Name { get; set; }
    Property Value
    Type Description
    System.String

    Type

    Declaration
    ImageType Type { get; set; }
    Property Value
    Type Description
    ImageType

    Methods

    Clone()

    Declaration
    IContentElement Clone()
    Returns
    Type Description
    IContentElement

    LoadFromFile(String)

    Declaration
    void LoadFromFile(string imagePath)
    Parameters
    Type Name Description
    System.String imagePath

    LoadFromStream(Stream)

    Declaration
    void LoadFromStream(Stream stream)
    Parameters
    Type Name Description
    System.IO.Stream stream

    Resize(Int32, Int32)

    Declaration
    void Resize(int width, int height)
    Parameters
    Type Name Description
    System.Int32 width
    System.Int32 height

    Inherited members

    Height
    Position
    Width
    Angle
    Remove()
    Replace(IContentElement)
    Parent
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet