Skip to main content
Namespace: VM.API.Post.Operations
Assembly: VM.API.Post.Operations.dll
A utility class that provides methods to convert string values to specific types.

Inheritance

object ← OperationAPIService

Methods

GetColorFrameRGB(int, int, int)

Converts the specified RGB values into a Color object.

Parameters

r int The red component of the color, ranging from 0 to 255. g int The green component of the color, ranging from 0 to 255. b int The blue component of the color, ranging from 0 to 255.

Returns

Color A Color object representing the color defined by the specified RGB values.

Examples

The following example demonstrates how to use the GetColorFromHexCode method:

Remarks

This method takes integer values for the red, green, and blue components and converts them into a Color. Each parameter should be within the range of 0 to 255 to ensure valid color representation.

GetColorFromHexCode(string)

Converts a hex color code to a Color.

Parameters

color string The hex color code string to be converted.

Returns

Color A Color that represents the converted color.

Examples

The following example demonstrates how to use the GetColorFromHexCode method:

Remarks

This method converts a hex color code (e.g., “#FF5733”) to a Color.

GetFontFaceFromString(string)

Converts a font face string to a FontFamily.

Parameters

fontface string The font face string to be converted.

Returns

FontFamily A FontFamily that represents the converted font face.

Examples

The following example demonstrates how to use the GetFontFaceFromString method:

Remarks

This method converts a font face string (e.g., “Arial”) to a FontFamily.

GetFontStyleFromString(string)

Converts a font style string to a FontStyle.

Parameters

fontstyle string The font style string to be converted (e.g., “Normal”, “Italic”, “Oblique”).

Returns

FontStyle A FontStyle that represents the converted font style.

Examples

The following example demonstrates how to use the GetFontStyleFromString method:

Remarks

This method converts a font style string (e.g., “Normal”, “Italic”, “Oblique”) to a FontStyle.

GetFontWeightFromString(string)

Converts a font weight string to a FontWeight.

Parameters

fontweight string The font weight string to be converted (e.g., “Normal”, “Bold”, “Thin”).

Returns

FontWeight A FontWeight that represents the converted font weight.

Examples

The following example demonstrates how to use the GetFontWeightFromString method:

Remarks

This method converts a font weight string (e.g., “Normal”, “Bold”, “Thin”) to a FontWeight.