net472_PropertyGridHelpers.UIEditors_ImageTextUIEditor_GetImageFromResourceFile - dparvin/PropertyGridHelpers GitHub Wiki

ImageTextUIEditor.GetImageFromResourceFile method

Gets the image from resource file.

public static Bitmap GetImageFromResourceFile(object Value, string ResourceItem, 
    string ResourcePath, string fileExtension, bool IsInDesignMode)
parameter description
Value The value.
ResourceItem The resource entry to retrieve.
ResourcePath Name of the resource.
fileExtension The file extension.
IsInDesignMode if set to true is in design mode.

Exceptions

exception condition
ArgumentNullException Value
ArgumentException '{nameof(ResourceItem)}' cannot be null or empty. - ResourceItem or '{nameof(ResourcePath)}' cannot be null or empty. - ResourcePath
InvalidOperationException Resource file '{ResourcePath}.resources' not found in assembly '{m}'. \n" + $"Available resources: {string.Join(", ", resourceNames)} or Error retrieving resource '{ResourceItem}{(string.IsNullOrEmpty(fileExtension) ? "" : $".{fileExtension}")}' at '{ResourcePath}' in Assembly '{Value.GetType().Assembly.GetName().Name}': {ex.Message} or Resource '{ResourcePath}.resources.{ResourceItem}' is not a valid image or byte array.
ArgumentNullException Value
ArgumentException '{nameof(ResourceItem)}' cannot be null or empty. - ResourceItem or '{nameof(ResourcePath)}' cannot be null or empty. - ResourcePath
InvalidOperationException Resource file '{ResourcePath}.resources' not found in assembly '{m}'. \n" + $"Available resources: {string.Join(", ", resourceNames)} or Resource '{ResourcePath}.resources.{ResourceItem}' is not a valid image or byte array.
InvalidOperationException Resource file '{ResourcePath}.resources' not found in assembly '{m}'. \n" + $"Available resources: {string.Join(", ", resourceNames)} or Resource '{ResourcePath}.resources.{ResourceItem}' is not a valid image or byte array.

See Also

⚠️ **GitHub.com Fallback** ⚠️