menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ColorConvert - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ColorConvert

    Conversion methods for a System.Drawing.Color to and from a string.

    Inheritance
    System.Object
    ColorConvert
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Drawing
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public sealed class ColorConvert

    Constructors

    ColorConvert()

    Declaration
    public ColorConvert()

    Methods

    ColorFromString(String)

    ColorFromString parses a string previously generated with ColorToString and returns a color.

    Declaration
    public static Color ColorFromString(string parseStr)
    Parameters
    Type Name Description
    System.String parseStr

    String generated with ColorToString.

    Returns
    Type Description
    System.Drawing.Color

    Color value that was encoded in parseStr.

    ColorToString(Color, Boolean)

    ColorToString creates a string from a color. All information such as knownColor and name in the color structure will be preserved.

    Declaration
    public static string ColorToString(Color color, bool writeName)
    Parameters
    Type Name Description
    System.Drawing.Color color
    System.Boolean writeName
    Returns
    Type Description
    System.String

    A string that can be passed as parameter to ColorFromString.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved