Methods
Load a Icon from an embedded resource and convert it to a bitmap of the specified size. Will look for a icon image that is greater than or equal to the requested size, if all images are less than the requested size the largest image will be used.
Load a Icon from an embedded resource and convert it to a bitmap of the specified size. Will look for a icon image that is greater than or equal to the requested size, if all images are less than the requested size the largest image will be used.
Create bitmap of a given size from an svg string
Create bitmap of a given size from an svg string
Create a series of closed polyline loops representing a curve and a linetype combination.
Preview geometry for a linetype on a curve, by channel, mirroring the viewport renderer. kind 0 returns the dash silhouette polygons with the line cleared under each shape (these are meant to be filled); kind 1 returns curve shape outlines (meant to be stroked); kind 2 returns text and surface shape outlines (meant to be filled with an even-odd rule).
public static Bitmap CreateMeshPreviewImage(IEnumerable<Mesh> meshes, IEnumerable<Color> colors, Size size)
Creates a preview image of one or more meshes.
Parameters:
| meshes (IEnumerable<Mesh>) | The meshes. |
| colors (IEnumerable<Color>) | The draw colors, one for each mesh. |
| size (Size) | The size of the preview image. |
Returns: A bitmap if successful, null otherwise.
Creates a preview image of a mesh.
public static Bitmap CreateMeshPreviewImage(RhinoDoc doc, IEnumerable<Mesh> meshes, IEnumerable<Color> colors, Size size)
Creates a preview image of one or more meshes.
Parameters:
| doc (RhinoDoc) | The active document. |
| meshes (IEnumerable<Mesh>) | The meshes. |
| colors (IEnumerable<Color>) | The draw colors, one for each mesh. |
| size (Size) | The size of the preview image. |
Returns: A bitmap if successful, null otherwise.
Attempt to adjust pixels to an image that works for dark mode
Load a Icon from an embedded resource.
Load a Icon from an embedded resource.
Parameters:
| resourceName (string) | The case-sensitive name of the icon manifest resource being requested. |
| size (Size) | The desired size of the icon. |
| assembly (Assembly = null) | The assembly containing the manifest resource, will use the calling assembly if null. |
Returns: The Icon resource if found and loaded otherwise null.
Load a Image from an embedded resource.
Loads an icon from an embedded resource and converts it to a bitmap. If the icon is not a standard size, this function scales down a larger image.
Parameters:
| iconName (string) | The case-sensitive name of the icon manifest resource being requested. |
| sizeDesired (int) | The desired size, in pixels, of the icon. |
| assembly (Assembly = null) | The assembly containing the manifest resource. |
Returns: The icon converted to a bitmap if successful, null otherwise.
Exceptions:
| ArgumentException | Thrown when iconName is not found as an embedded resource in the specified assembly. |
Loads an icon from an embedded resource. If the icon is not a standard size, this function scales down a larger image.
Parameters:
| iconName (string) | The case-sensitive name of the icon manifest resource being requested. |
| sizeDesired (int) | The desired size, in pixels, of the icon. |
| assembly (Assembly = null) | The assembly containing the manifest resource. |
Returns: The icon if successful, null otherwise.
Exceptions:
| ArgumentException | Thrown when iconName is not found as an embedded resource in the specified assembly. |
Stores a color into an integer from 4 bytes.
Get array of bytes that represent RGBA values for an image of a given size created from SVG
Parameters:
| svg (string) | A valid svg string |
| width (int) | Width of the svg in pixels |
| height (int) | Height of the svg in pixels |
| premultiplyAlpha (bool) | Pre-lends the background color with the pixels based on their alpha value |
| backgroundColor (Color) | Background color - pass Color.Empty if you don't know what to pass. |
| adjustForDarkMode (bool) | If true swaps any available attributes for their dark mode counterparts> |
Returns: Null on an exception, an array of Color as bytes otherwise
Get array of bytes that represent RGBA values for an image of a given size created from SVG
Parameters:
| svg (string) | A valid svg string |
| width (int) | Width of the svg in pixels |
| height (int) | Height of the svg in pixels |
| premultiplyAlpha (bool) | Pre-lends the background color with the pixels based on their alpha value |
| backgroundColor (Color) | Background color - pass Color.Empty if you don't know what to pass. |
Returns: Null on an exception, an array of Color as bytes otherwise