←Select platform

RasterColor Constructor(int,int,int)

Summary
Initializes a new RasterColor structure with specific values for red, green and blue.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public RasterColor( 
   int red, 
   int green, 
   int blue 
) 
- (instancetype)initWithRed:(NSInteger)red  
                      green:(NSInteger)green  
                       blue:(NSInteger)blue 
public RasterColor( 
   int red, 
   int green, 
   int blue 
); 
public: 
RasterColor(  
   int red, 
   int green, 
   int blue 
) 
__init__(self,red,green,blue) # Overloaded constructor 

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.

Remarks

The alpha value will be set to MaximumComponent.

Example
C#
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); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.16
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.