Initializes a new
RasterColor structure with specific values for red, green and blue.
Syntax
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)
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
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also