Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Project Class / Preview Property
Example
In This Topic
    Preview Property (Project)
    In This Topic
    Project's preview image.
    Syntax
    public Image Preview {get; set;}
    Exceptions
    ExceptionDescription
    The object is in invalid state. Obtain a new one.

    Internal error of HpD or HpD API.

    IMPORTANT: Throwing this exception changes HpD Api's state to Failed.

    The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.
    Remarks
    Gets or sets the image that is shown as preview of this project.
    Example
    // Open project.
    HpdApi api = HpdApi.GetInstance();
    Project project = api.OpenProject("path to a project");
    
    // Get current preview of the project.
    Image preview = project.Preview;
    
    // Set an image as new preview of this project.
    project.Preview = Bitmap.FromFile("path to an image");
    
    project.Save();
    See Also