LEADTOOLS (Leadtools assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
RasterColorTypeConverter Class
See Also  Members  
Leadtools Namespace : RasterColorTypeConverter Class



Converts RasterColor objects from one data type to another. Access this class through the System.ComponentModel.TypeConverterSupported in Silverlight, Windows Phone 7

Object Model

RasterColorTypeConverter Class

Syntax

Visual Basic (Declaration) 
Public Class RasterColorTypeConverter 
   Inherits System.ComponentModel.TypeConverter
Visual Basic (Usage)Copy Code
Dim instance As RasterColorTypeConverter
C# 
public class RasterColorTypeConverter : System.ComponentModel.TypeConverter 
C++/CLI 
public ref class RasterColorTypeConverter : public System.ComponentModel.TypeConverter 

Example

Visual BasicCopy Code
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
C#Copy Code
public void RasterColorTypeConverterExample()
{
   RasterColor clr;

   // 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
   string temp = clr.ToString();
   // Convert it back to color
   clr = RasterColorTypeConverter.ConvertFromString(temp);
   Console.WriteLine(temp + ": " + clr.ToString());
}
SilverlightCSharpCopy Code
SilverlightVBCopy Code

Remarks

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 withought creating a System.ComponentModel.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.

Inheritance Hierarchy

System.Object
   System.ComponentModel.TypeConverter
      Leadtools.RasterColorTypeConverter

Requirements

Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only), Windows Phone 7

See Also