Color.G Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the green component value of this Color structure.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

member G : byte with get

Property Value

Type: System.Byte

The green component value of this Color.

The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). Each of the four components is a number from 0 through 255, with 0 representing no intensity and 255 representing full intensity. Likewise, G is a value from 0 to 255 with 0 representing no green and 255 representing fully green.

The following code example demonstrates the A, R, G, and B properties of a Color, and the Implicit(Size to SizeF) member.

This example is designed to be used with a Windows Form. Paste the code into the form and call the ShowPropertiesOfSlateBlue method from the form's Paint event-handling method, passing e as PaintEventArgs.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: