Table of Contents

Method FromFile

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

FromFile(string)

Makes an icon from an image file, its bytes read and copied at once, so that the file is not held open and can be deleted or replaced. A plugin names a file beside it with Path.Combine(host.Folder, "circle16.png").

public static CadPluginIcon FromFile(string path)

Parameters

path string

The full path of the file; a relative path is refused.

Returns

CadPluginIcon

The icon.

Exceptions

ArgumentNullException

Thrown when the path is null.

ArgumentException

Thrown when the path is not a full path, or the file is empty.

IOException

Thrown when the file cannot be read.