RhinoCommon API
DrawingUtilitiesLoadBitmapWithScaleDown Method |
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.
Namespace: Rhino.UI
Assembly: RhinoCommon (in RhinoCommon.dll)

public static Bitmap LoadBitmapWithScaleDown( string iconName, int sizeDesired, Assembly assembly = null )
Public Shared Function LoadBitmapWithScaleDown ( iconName As String, sizeDesired As Integer, Optional assembly As Assembly = Nothing ) As Bitmap
Parameters
- iconName
- Type: SystemString
The case-sensitive name of the icon manifest resource being requested. - sizeDesired
- Type: SystemInt32
The desired size, in pixels, of the icon. - assembly (Optional)
- Type: System.ReflectionAssembly
The assembly containing the manifest resource.
Return Value
Type: BitmapThe icon converted to a bitmap if successful, null otherwise.

Exception | Condition |
---|---|
ArgumentException | Thrown when iconName is not found as an embedded resource in the specified assembly. |

Rhino for Windows
Supported in: 6.8