[SerializableAttribute()]
public struct RasterColor
@interface LTRasterColor : NSObject <NSCopying, NSCoding>
public final class RasterColor
[SerializableAttribute()]
public value class RasterColor : public System.ValueType
class RasterColor:
The LEADTOOLS RasterColor class provides a platform independent representation of an ARGB color that can be used in any platform supported by LEADTOOLS such as GDI, GDI+, and WPF.
To convert a LEADTOOLS RasterColor object to/from a device dependent color, you can either use the various properties of methods of this class (such as the A, R, G, B properties and the RasterColor(int alpha, int red, int green, int blue) constructor) directly, or use the following helper classes:
In the Document and Medical toolkits, the COLORREF value can represent a 16-bit grayscale value if RasterImage is a 12- or 16-bit grayscale bitmap. To avoid confusion with an RGB value, set the COLORREF_GRAY16 mask (0x04000000). In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000 is 16-bit black.) These are not standard Windows values. Therefore, although LEADTOOLS methods will recognize a COLORREF having this format, Windows methods will not.
Converts a .NET color to a RasterColor and back.
using Leadtools;
public void Example()
{
const int A = 128, R = 24, G = 87, B = 134;
// Create a RasterColor
RasterColor clr = new RasterColor(A, R, G, B);
// Make sure the color is correct
Assert.IsTrue(clr.A == A);
Assert.IsTrue(clr.R == R);
Assert.IsTrue(clr.G == G);
Assert.IsTrue(clr.B == B);
// Show its value
Console.WriteLine(clr);
// Show the A, R, G and B values
Console.WriteLine("Alpha value: " + clr.A);
Console.WriteLine("Red value: " + clr.R);
Console.WriteLine("Green value: " + clr.G);
Console.WriteLine("Blue value: " + clr.B);
}
import java.io.File;
import java.io.IOException;
import java.util.Random;
import org.junit.*;
import org.junit.Test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import static org.junit.Assert.*;
import leadtools.*;
public void rasterColorExample() {
final int A = 128, R = 24, G = 87, B = 134;
// Create a RasterColor
RasterColor clr = new RasterColor(A, R, G, B);
// Make sure the color is correct
assertTrue(clr.a() == A);
assertTrue(clr.r() == R);
assertTrue(clr.g() == G);
assertTrue(clr.b() == B);
// Show its value
System.out.println(clr);
// Show the A, R, G and B values
System.out.println("Alpha value: " + clr.a());
System.out.println("Red value: " + clr.r());
System.out.println("Green value: " + clr.g());
System.out.println("Blue value: " + clr.b());
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
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.