Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
RasterColor Constructor(Int32,Int32,Int32)
See Also  Example
Leadtools Namespace > RasterColor Structure > RasterColor Constructor : RasterColor Constructor(Int32,Int32,Int32)



red
The red component value for the new Color structure. Valid values are MinimumComponent through MaximumComponent.
green
The green component value for the new Color structure. Valid values are MinimumComponent through MaximumComponent.
blue
The blue component value for the new Color structure. Valid values are MinimumComponent through MaximumComponent.
Initializes a new RasterColor structure with specific values for red, green and blue.

Syntax

Visual Basic (Declaration)  
Public Function New( _
   ByVal red As Integer, _
   ByVal green As Integer, _
   ByVal blue As Integer _
)
Visual Basic (Usage) Copy Code
Dim red As Integer
Dim green As Integer
Dim blue As Integer
 
Dim instance As RasterColor(red, green, blue)
C#  
public RasterColor( 
   int red,
   int green,
   int blue
)
C++/CLI  
public:
RasterColor( 
   int red,
   int green,
   int blue
)

Parameters

red
The red component value for the new Color structure. Valid values are MinimumComponent through MaximumComponent.
green
The green component value for the new Color structure. Valid values are MinimumComponent through MaximumComponent.
blue
The blue component value for the new Color structure. Valid values are MinimumComponent through MaximumComponent.

Example

Visual Basic Copy Code
Public Sub RasterColorExample()
 Dim rand As Random = New Random()

 Dim a As Byte = CByte(rand.Next(256))
 Dim r As Byte = CByte(rand.Next(256))
 Dim g As Byte = CByte(rand.Next(256))
 Dim b As Byte = CByte(rand.Next(256))

 Dim clr As RasterColor = New RasterColor(a, r, g, b)

 ' Check
 Debug.Assert(clr.A = a)
 Debug.Assert(clr.R = r)
 Debug.Assert(clr.G = g)
 Debug.Assert(clr.B = b)
      End Sub
C# Copy Code
public void RasterColorExample() 

   Random rand = new Random(); 
 
   byte a = (byte)rand.Next(256); 
   byte r = (byte)rand.Next(256); 
   byte g = (byte)rand.Next(256); 
   byte b = (byte)rand.Next(256); 
 
   RasterColor clr = new RasterColor(a, r, g, b); 
 
   // Check 
   Debug.Assert(clr.A == a); 
   Debug.Assert(clr.R == r); 
   Debug.Assert(clr.G == g); 
   Debug.Assert(clr.B == b); 
}

Remarks

The alpha value will be set to MaximumComponent.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also