←Select platform

G Property

Summary
Gets or sets the green component of this RasterColor structure.
Syntax
C#
Objective-C
C++/CLI
Java
Python
[CLSCompliantAttribute(false)] 
public ushort G { get; set; } 
@property (nonatomic, assign) unsigned short g; 
public short getG(); 
public void setG( 
   short shortValue 
); 
[CLSCompliantAttribute(false)] 
public: 
property ushort G { 
   ushort get(); 
   void set (    ushort ); 
} 
G # get and set (RasterColor16) 

Property Value

The green component of this RasterColor structure.

Example
C#
Java
using Leadtools; 
 
 
public void RasterColor16ComponentsExample() 
{ 
	// This C# example shows how to create a normal grayscale LUT. 
	RasterColor16[] lut = new RasterColor16[1024]; 
	RasterColor16 color = new RasterColor16(0, 0, 0); 
	for (ushort i = 0; i < 1024; i++) 
	{ 
		int gray = i * 65535 / 1023; 
		color.R = (ushort)gray; 
		color.G = (ushort)gray; 
		color.B = (ushort)gray; 
		lut[i] = color; 
	} 
} 
 
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 rasterColor16ComponentsExample() { 
   // This C# example shows how to create a normal grayscale LUT. 
   RasterColor16[] lut = new RasterColor16[1024]; 
   RasterColor16 color = new RasterColor16(0, 0, 0); 
   for (short i = 0; i < 1024; i++) { 
      int gray = i * 65535 / 1023; 
      color.setR((short) gray); 
      assertTrue(color.getR() == (short) gray); 
      color.setG((short) gray); 
      assertTrue(color.getG() == (short) gray); 
      color.setB((short) gray); 
      assertTrue(color.getB() == (short) gray); 
      lut[i] = color; 
   } 
} 
Requirements

Target Platforms

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

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