Harness proD API Help
EPLAN.Harness.API.Plugins.Core Namespace / IPluginDisplayInfo Interface / ImageStream Property
Example
In This Topic
    ImageStream Property
    In This Topic
    Image to be displayed in button if plugin successfully loaded.
    Syntax
    Stream ImageStream {get;}
    Remarks
    SVG and raster images are supported. Raster image should be of size 32 x 32 for large buttons or 16 x 16 for small buttons, otherwise resizing will be applied. Only one image in per stream is supported.
    Example
    The example shows how define an image from resource file.
    public Stream ImageStream { get; protected set; } = new MemoryStream(Resources.Image);
    The example shows how to load an image from external file.
    public void Initialize()
    {
    try
    {
    if (!File.Exists(_pictureFilepath))
    return;
    
    FileStream stream = new FileStream(_pictureFilepath, FileMode.Open);
    {
    ImageStream = stream;
    }
    }
    catch (Exception)
    {
    // Log exception.
    }
    }
    See Also