Converts RasterColor objects from one data type to another. Access this class through the TypeConverter
public class RasterColorTypeConverter : TypeConverter
Public Class RasterColorTypeConverter
Inherits System.ComponentModel.TypeConverter
public ref class RasterColorTypeConverter : public System.ComponentModel.TypeConverter
To convert a RasterColor to a string value, use the RasterColor.ToString method.
You can use the members of this class to convert a string to a RasterColor value. You can also use the helper static (Shared) RasterColorTypeConverter.ConvertFromString method directly without creating a TypeConverter instance.
Currently, this class supports converting a RasterColor to and from a string type only. The string can be in an HTML compatible format.
using Leadtools;
public void RasterColorTypeConverterExample()
{
RasterColor clr;
// Convert different type of color string representation to RasterColor objects
clr = RasterColorTypeConverter.ConvertFromString("Red");
Assert.IsTrue(clr.ToString() == "#FFFF0000");
Console.WriteLine("Red: " + clr.ToString());
clr = RasterColorTypeConverter.ConvertFromString("BLUE");
Assert.IsTrue(clr.ToString() == "#FF0000FF");
Console.WriteLine("BLUE: " + clr.ToString());
clr = RasterColorTypeConverter.ConvertFromString("#F3AABBCC");
Assert.IsTrue(clr.ToString() == "#F3AABBCC");
Console.WriteLine("#F3AABBCC: " + clr.ToString());
// Convert this last color back to string
string temp = clr.ToString();
// Convert it back to color
clr = RasterColorTypeConverter.ConvertFromString(temp);
Assert.IsTrue(clr.ToString() == temp);
Console.WriteLine(temp + ": " + clr.ToString());
}
Imports Leadtools
Public Sub RasterColorTypeConverterExample()
Dim clr As RasterColor
' Convert different type of color string representation to RasterColor objects
clr = RasterColorTypeConverter.ConvertFromString("Red")
Console.WriteLine("Red: " + clr.ToString())
clr = RasterColorTypeConverter.ConvertFromString("BLUE")
Console.WriteLine("BLUE: " + clr.ToString())
clr = RasterColorTypeConverter.ConvertFromString("#F3AABBCC")
Console.WriteLine("#F3AABBCC: " + clr.ToString())
' Convert this last color back to string
Dim temp As String = clr.ToString()
' Convert it back to color
clr = RasterColorTypeConverter.ConvertFromString(temp)
Console.WriteLine(temp + ": " + clr.ToString())
End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.