Table of Contents

Method FromResource

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

FromResource(Assembly, string)

Makes an icon from an image the assembly embeds, its bytes read and copied at once. The name is the resource's full name, "MyPlugin.circle16.png" for circle16.png of a project whose root namespace is MyPlugin.

public static CadPluginIcon FromResource(Assembly assembly, string resourceName)

Parameters

assembly Assembly

The assembly that embeds it, usually the plugin's own.

resourceName string

The resource's full name.

Returns

CadPluginIcon

The icon.

Exceptions

ArgumentNullException

Thrown when the assembly or the name is null.

ArgumentException

Thrown when the assembly has no such resource, or it is empty.