Initializes a new RasterColor structure with specific values for red, green and blue.
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.
The alpha value will be set to MaximumComponent.
using Leadtools;
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
Assert.IsTrue(clr.A == a);
Assert.IsTrue(clr.R == r);
Assert.IsTrue(clr.G == g);
Assert.IsTrue(clr.B == b);
}
Imports Leadtools
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
using Leadtools;
using Leadtools.Windows.Media;
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);
}
Imports Leadtools
Imports Leadtools.Windows.Media
<TestMethod>
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
Products |
Support |
Feedback: RasterColor Constructor(Int32,Int32,Int32) - Leadtools |
Introduction |
Help Version 19.0.2017.6.19
|
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.