Creates a new RasterColor structure from a known color.
[CLSCompliantAttribute(false)]
public static Leadtools.RasterColor FromKnownColor(
Leadtools.RasterKnownColor knownColor
)
<CLSCompliantAttribute(False)>
Public Shared Function FromKnownColor( _
ByVal knownColor As Leadtools.RasterKnownColor _
) As Leadtools.RasterColor
[CLSCompliantAttribute(false)]
public:
static Leadtools.RasterColor FromKnownColor(
Leadtools.RasterKnownColor knownColor
)
knownColor
One of the RasterKnownColor enumeration members.
The new RasterColor object.
You can use the RasterKnownColor enumeration to construct RasterColor objects from colors known by name.
using Leadtools;
public void FromKnownColorExample()
{
// Create a yellow color (R = 255, G = 255, B = 0)
RasterColor clr1 = new RasterColor(255, 255, 0);
// Now create the same color using the "Yellow" known color
RasterColor clr2 = RasterColor.FromKnownColor(RasterKnownColor.Yellow);
// Make sure both colors have the same value
Assert.IsTrue(clr1.A == clr2.A);
Assert.IsTrue(clr1.R == clr2.R);
Assert.IsTrue(clr1.G == clr2.G);
Assert.IsTrue(clr1.B == clr2.B);
}
Imports Leadtools
Public Sub FromKnownColorExample()
' Create a yellow color (R = 255, G = 255, B = 0)
Dim clr1 As New RasterColor(255, 255, 0)
' Now create the same color using the "Yellow" known color
Dim clr2 As RasterColor = RasterColor.FromKnownColor(RasterKnownColor.Yellow)
' Make sure both colors have the same value
Debug.Assert(clr1.A = clr2.A)
Debug.Assert(clr1.R = clr2.R)
Debug.Assert(clr1.G = clr2.G)
Debug.Assert(clr1.B = clr2.B)
End Sub
Products |
Support |
Feedback: FromKnownColor Method (RasterColor) - 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.