Color. R Свойство
Определение
Получает значение красного компонента этой структуры Color. Gets the red component value of this Color structure.
Значение свойства
Значение красного компонента этого объекта Color. The red component value of this Color.
Примеры
В следующем примере кода демонстрируются A R свойства,, G и элемента B Color , а также Implicit элемент. The following code example demonstrates the A, R, G, and B properties of a Color, and the Implicit member.
Этот пример предназначен для использования с Windows Form. This example is designed to be used with a Windows Form. Вставьте код в форму и вызовите ShowPropertiesOfSlateBlue метод из формы Paint метода обработки событий, передав его e как PaintEventArgs . Paste the code into the form and call the ShowPropertiesOfSlateBlue method from the form’s Paint event-handling method, passing e as PaintEventArgs.
Комментарии
Цвет каждого пикселя представлен в виде 32-разрядного числа: по 8 бит для альфа-канала, красного, зеленого и синего (ARGB). The color of each pixel is represented as a 32-bit number: 8 bits each for alpha, red, green, and blue (ARGB). Каждый из четырех компонентов — это число от 0 до 255, где 0 означает отсутствие интенсивности и 255, представляющие полную интенсивность. Each of the four components is a number from 0 through 255, with 0 representing no intensity and 255 representing full intensity. Подоб Likewise,
R — Это значение от 0 до 255 с 0, обозначающее отсутствие красного и 255, представляющее полностью красный. R is a value from 0 to 255 with 0 representing no red and 255 representing fully red.
System Colors Класс
Определение
Каждое свойство класса SystemColors является структурой Color, которая представляет собой цвет элемента изображения Windows. Each property of the SystemColors class is a Color structure that is the color of a Windows display element.
Примеры
В следующем примере кода демонстрируется использование Equality оператора и SystemColors класса. The following code example demonstrates the Equality operator and the SystemColors class. Этот пример предназначен для использования с формой Windows Forms, содержащей кнопку с именем Button1 . This example is designed to be used with a Windows Form that contains a button named Button1 . Вставьте следующий код в форму и свяжите Button1_Click метод с Click событием кнопки. Paste the following code into your form and associate the Button1_Click method with the button’s Click event.
Комментарии
Более высокая производительность достигается за счет использования свойств SystemPens классов или SystemBrushes вместо создания нового пера или кисти на основе значения из SystemColors . Better performance is achieved by using the properties of the SystemPens or SystemBrushes classes rather than creating a new pen or brush based on a value from SystemColors. Например, если вы хотите получить кисть для цвета лицевой стороны трехмерного элемента, используйте SystemBrushes.Control свойство, так как оно получает уже существующую кисть, а вызов SolidBrush конструктора со значением параметра SystemColors.Control создаст новую кисть. For example, if you wanted to get a brush for the face color of a 3-D element, use the SystemBrushes.Control property because it gets a brush that already exists, whereas calling the SolidBrush constructor with a parameter value of SystemColors.Control will create a new brush.
Свойства
Возвращает структуру Color, которая является цветом границ активного окна. Gets a Color structure that is the color of the active window’s border.
Возвращает структуру Color, являющуюся цветом фона строки заголовка активного окна. Gets a Color structure that is the color of the background of the active window’s title bar.
Получает структуру Color, представляющую собой цвет текста в строке заголовка активного окна. Gets a Color structure that is the color of the text in the active window’s title bar.
Получает структуру Color, являющуюся цветом рабочей области приложения. Gets a Color structure that is the color of the application workspace.
Возвращает структуру Color, являющуюся цветом лицевой стороны трехмерного элемента. Gets a Color structure that is the face color of a 3-D element.
Возвращает структуру Color, являющуюся цветом выделения трехмерного элемента. Gets a Color structure that is the highlight color of a 3-D element.
Возвращает структуру Color, являющуюся цветом тени трехмерного элемента. Gets a Color structure that is the shadow color of a 3-D element.
Возвращает структуру Color, являющуюся цветом лицевой стороны трехмерного элемента. Gets a Color structure that is the face color of a 3-D element.
Возвращает структуру Color, являющуюся цветом тени трехмерного элемента. Gets a Color structure that is the shadow color of a 3-D element.
Возвращает структуру Color, являющуюся темным цветом тени трехмерного элемента. Gets a Color structure that is the dark shadow color of a 3-D element.
Возвращает структуру Color, являющуюся светлым цветом трехмерного элемента. Gets a Color structure that is the light color of a 3-D element.
Возвращает структуру Color, являющуюся цветом выделения трехмерного элемента. Gets a Color structure that is the highlight color of a 3-D element.
Возвращает структуру Color, являющуюся цветом текста в трехмерном элементе. Gets a Color structure that is the color of text in a 3-D element.
Получает структуру Color, представляющую собой цвет рабочего стола. Gets a Color structure that is the color of the desktop.
Возвращает структуру Color, являющуюся самым светлым цветом градиента цвета в строке заголовка активного окна. Gets a Color structure that is the lightest color in the color gradient of an active window’s title bar.
Возвращает структуру Color, являющуюся самым светлым цветом градиента цвета в строке заголовка неактивного окна. Gets a Color structure that is the lightest color in the color gradient of an inactive window’s title bar.
Возвращает структуру Color, являющуюся цветом серого текста. Gets a Color structure that is the color of dimmed text.
Возвращает структуру Color, являющуюся цветом фона выбранных элементов. Gets a Color structure that is the color of the background of selected items.
Получает структуру Color, которая представляет собой цвет текста выбранных элементов. Gets a Color structure that is the color of the text of selected items.
Получает структуру Color, представляющую цвет, используемый для обозначения активно отслеживаемого элемента. Gets a Color structure that is the color used to designate a hot-tracked item.
Получает структуру Color, которая представляет цвет границы неактивного окна. Gets a Color structure that is the color of an inactive window’s border.
Возвращает структуру Color, являющуюся цветом фона строки заголовка неактивного окна. Gets a Color structure that is the color of the background of an inactive window’s title bar.
Возвращает структуру Color, являющуюся цветом текста в строке заголовка неактивного окна. Gets a Color structure that is the color of the text in an inactive window’s title bar.
Возвращает структуру Color, являющуюся цветом фона всплывающей подсказки. Gets a Color structure that is the color of the background of a ToolTip.
Возвращает структуру Color, являющуюся цветом текста всплывающей подсказки. Gets a Color structure that is the color of the text of a ToolTip.
Возвращает структуру Color, которая является цветом фона меню. Gets a Color structure that is the color of a menu’s background.
Возвращает структуру Color, являющуюся цветом фона строки меню. Gets a Color structure that is the color of the background of a menu bar.
Возвращает структуру Color, являющуюся цветом, используемым для выделения пунктов меню, когда меню отображается как плоское меню. Gets a Color structure that is the color used to highlight menu items when the menu appears as a flat menu.
Возвращает структуру Color, которая является цветом текста меню. Gets a Color structure that is the color of a menu’s text.
Возвращает структуру Color, являющуюся цветом фона полосы прокрутки. Gets a Color structure that is the color of the background of a scroll bar.
Возвращает структуру Color, являющуюся цветом фона клиентской области окна. Gets a Color structure that is the color of the background in the client area of a window.
Получает структуру Color, которая является цветом рамки окна. Gets a Color structure that is the color of a window frame.
Получает структуру Color, являющуюся цветом текста в клиентской области окна. Gets a Color structure that is the color of the text in the client area of a window.
Color Struct
Definition
Represents an ARGB (alpha, red, green, blue) color.
Examples
The following code example demonstrates the A, R, G, and B properties of a Color, and the Implicit 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.
Remarks
Named colors are represented by using the properties of the Color structure. For more information about these colors, see Colors by Name.
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. The alpha component specifies the transparency of the color: 0 is fully transparent, and 255 is fully opaque. To determine the alpha, red, green, or blue component of a color, use the A, R, G, or B property, respectively. You can create a custom color by using one of the FromArgb methods.
Fields
Represents a color that is null .
Properties
Gets the alpha component value of this Color structure.
Gets a system-defined color that has an ARGB value of #FFF0F8FF .
Gets a system-defined color that has an ARGB value of #FFFAEBD7 .
Gets a system-defined color that has an ARGB value of #FF00FFFF .
Gets a system-defined color that has an ARGB value of #FF7FFFD4 .
Gets a system-defined color that has an ARGB value of #FFF0FFFF .
Gets the blue component value of this Color structure.
Gets a system-defined color that has an ARGB value of #FFF5F5DC .
Gets a system-defined color that has an ARGB value of #FFFFE4C4 .
Gets a system-defined color that has an ARGB value of #FF000000 .
Gets a system-defined color that has an ARGB value of #FFFFEBCD .
Gets a system-defined color that has an ARGB value of #FF0000FF .
Gets a system-defined color that has an ARGB value of #FF8A2BE2 .
Gets a system-defined color that has an ARGB value of #FFA52A2A .
Gets a system-defined color that has an ARGB value of #FFDEB887 .
Gets a system-defined color that has an ARGB value of #FF5F9EA0 .
Gets a system-defined color that has an ARGB value of #FF7FFF00 .
Gets a system-defined color that has an ARGB value of #FFD2691E .
Gets a system-defined color that has an ARGB value of #FFFF7F50 .
Gets a system-defined color that has an ARGB value of #FF6495ED .
Gets a system-defined color that has an ARGB value of #FFFFF8DC .
Gets a system-defined color that has an ARGB value of #FFDC143C .
Gets a system-defined color that has an ARGB value of #FF00FFFF .
Gets a system-defined color that has an ARGB value of #FF00008B .
Gets a system-defined color that has an ARGB value of #FF008B8B .
Gets a system-defined color that has an ARGB value of #FFB8860B .
Gets a system-defined color that has an ARGB value of #FFA9A9A9 .
Gets a system-defined color that has an ARGB value of #FF006400 .
Gets a system-defined color that has an ARGB value of #FFBDB76B .
Gets a system-defined color that has an ARGB value of #FF8B008B .
Gets a system-defined color that has an ARGB value of #FF556B2F .
Gets a system-defined color that has an ARGB value of #FFFF8C00 .
Gets a system-defined color that has an ARGB value of #FF9932CC .
Gets a system-defined color that has an ARGB value of #FF8B0000 .
Gets a system-defined color that has an ARGB value of #FFE9967A .
Gets a system-defined color that has an ARGB value of #FF8FBC8B .
Gets a system-defined color that has an ARGB value of #FF483D8B .
Gets a system-defined color that has an ARGB value of #FF2F4F4F .
Gets a system-defined color that has an ARGB value of #FF00CED1 .
Gets a system-defined color that has an ARGB value of #FF9400D3 .
Gets a system-defined color that has an ARGB value of #FFFF1493 .
Gets a system-defined color that has an ARGB value of #FF00BFFF .
Gets a system-defined color that has an ARGB value of #FF696969 .
Gets a system-defined color that has an ARGB value of #FF1E90FF .
Gets a system-defined color that has an ARGB value of #FFB22222 .
Gets a system-defined color that has an ARGB value of #FFFFFAF0 .
Gets a system-defined color that has an ARGB value of #FF228B22 .
Gets a system-defined color that has an ARGB value of #FFFF00FF .
Gets the green component value of this Color structure.
Gets a system-defined color that has an ARGB value of #FFDCDCDC .
Gets a system-defined color that has an ARGB value of #FFF8F8FF .
Gets a system-defined color that has an ARGB value of #FFFFD700 .
Gets a system-defined color that has an ARGB value of #FFDAA520 .
Gets a system-defined color that has an ARGB value of #FF808080 .
Gets a system-defined color that has an ARGB value of #FF008000 .
Gets a system-defined color that has an ARGB value of #FFADFF2F .
Gets a system-defined color that has an ARGB value of #FFF0FFF0 .
Gets a system-defined color that has an ARGB value of #FFFF69B4 .
Gets a system-defined color that has an ARGB value of #FFCD5C5C .
Gets a system-defined color that has an ARGB value of #FF4B0082 .
Specifies whether this Color structure is uninitialized.
Gets a value indicating whether this Color structure is a predefined color. Predefined colors are represented by the elements of the KnownColor enumeration.
Gets a value indicating whether this Color structure is a named color or a member of the KnownColor enumeration.
Gets a value indicating whether this Color structure is a system color. A system color is a color that is used in a Windows display element. System colors are represented by elements of the KnownColor enumeration.
Gets a system-defined color that has an ARGB value of #FFFFFFF0 .
Gets a system-defined color that has an ARGB value of #FFF0E68C .
Gets a system-defined color that has an ARGB value of #FFE6E6FA .
Gets a system-defined color that has an ARGB value of #FFFFF0F5 .
Gets a system-defined color that has an ARGB value of #FF7CFC00 .
Gets a system-defined color that has an ARGB value of #FFFFFACD .
Gets a system-defined color that has an ARGB value of #FFADD8E6 .
Gets a system-defined color that has an ARGB value of #FFF08080 .
Gets a system-defined color that has an ARGB value of #FFE0FFFF .
Gets a system-defined color that has an ARGB value of #FFFAFAD2 .
Gets a system-defined color that has an ARGB value of #FFD3D3D3 .
Gets a system-defined color that has an ARGB value of #FF90EE90 .
Gets a system-defined color that has an ARGB value of #FFFFB6C1 .
Gets a system-defined color that has an ARGB value of #FFFFA07A .
Gets a system-defined color that has an ARGB value of #FF20B2AA .
Gets a system-defined color that has an ARGB value of #FF87CEFA .
Gets a system-defined color that has an ARGB value of #FF778899 .
Gets a system-defined color that has an ARGB value of #FFB0C4DE .
Gets a system-defined color that has an ARGB value of #FFFFFFE0 .
Gets a system-defined color that has an ARGB value of #FF00FF00 .
Gets a system-defined color that has an ARGB value of #FF32CD32 .
Gets a system-defined color that has an ARGB value of #FFFAF0E6 .
Gets a system-defined color that has an ARGB value of #FFFF00FF .
Gets a system-defined color that has an ARGB value of #FF800000 .
Gets a system-defined color that has an ARGB value of #FF66CDAA .
Gets a system-defined color that has an ARGB value of #FF0000CD .
Gets a system-defined color that has an ARGB value of #FFBA55D3 .
Gets a system-defined color that has an ARGB value of #FF9370DB .
Gets a system-defined color that has an ARGB value of #FF3CB371 .
Gets a system-defined color that has an ARGB value of #FF7B68EE .
Gets a system-defined color that has an ARGB value of #FF00FA9A .
Gets a system-defined color that has an ARGB value of #FF48D1CC .
Gets a system-defined color that has an ARGB value of #FFC71585 .
Gets a system-defined color that has an ARGB value of #FF191970 .
Gets a system-defined color that has an ARGB value of #FFF5FFFA .
Gets a system-defined color that has an ARGB value of #FFFFE4E1 .
Gets a system-defined color that has an ARGB value of #FFFFE4B5 .
Gets the name of this Color.
Gets a system-defined color that has an ARGB value of #FFFFDEAD .
Gets a system-defined color that has an ARGB value of #FF000080 .
Gets a system-defined color that has an ARGB value of #FFFDF5E6 .
Gets a system-defined color that has an ARGB value of #FF808000 .
Gets a system-defined color that has an ARGB value of #FF6B8E23 .
Gets a system-defined color that has an ARGB value of #FFFFA500 .
Gets a system-defined color that has an ARGB value of #FFFF4500 .
Gets a system-defined color that has an ARGB value of #FFDA70D6 .
Gets a system-defined color that has an ARGB value of #FFEEE8AA .
Gets a system-defined color that has an ARGB value of #FF98FB98 .
Gets a system-defined color that has an ARGB value of #FFAFEEEE .
Gets a system-defined color that has an ARGB value of #FFDB7093 .
Gets a system-defined color that has an ARGB value of #FFFFEFD5 .
Gets a system-defined color that has an ARGB value of #FFFFDAB9 .
Gets a system-defined color that has an ARGB value of #FFCD853F .
Gets a system-defined color that has an ARGB value of #FFFFC0CB .
Gets a system-defined color that has an ARGB value of #FFDDA0DD .
Gets a system-defined color that has an ARGB value of #FFB0E0E6 .
Gets a system-defined color that has an ARGB value of #FF800080 .
Gets the red component value of this Color structure.
Gets a system-defined color that has an ARGB value of #FFFF0000 .
Gets a system-defined color that has an ARGB value of #FFBC8F8F .
Gets a system-defined color that has an ARGB value of #FF4169E1 .
Gets a system-defined color that has an ARGB value of #FF8B4513 .
Gets a system-defined color that has an ARGB value of #FFFA8072 .
Gets a system-defined color that has an ARGB value of #FFF4A460 .
Gets a system-defined color that has an ARGB value of #FF2E8B57 .
Gets a system-defined color that has an ARGB value of #FFFFF5EE .
Gets a system-defined color that has an ARGB value of #FFA0522D .
Gets a system-defined color that has an ARGB value of #FFC0C0C0 .
Gets a system-defined color that has an ARGB value of #FF87CEEB .
Gets a system-defined color that has an ARGB value of #FF6A5ACD .
Gets a system-defined color that has an ARGB value of #FF708090 .
Gets a system-defined color that has an ARGB value of #FFFFFAFA .
Gets a system-defined color that has an ARGB value of #FF00FF7F .
Gets a system-defined color that has an ARGB value of #FF4682B4 .
Gets a system-defined color that has an ARGB value of #FFD2B48C .
Gets a system-defined color that has an ARGB value of #FF008080 .
Gets a system-defined color that has an ARGB value of #FFD8BFD8 .
Gets a system-defined color that has an ARGB value of #FFFF6347 .
Gets a system-defined color.
Gets a system-defined color that has an ARGB value of #FF40E0D0 .
Gets a system-defined color that has an ARGB value of #FFEE82EE .
Gets a system-defined color that has an ARGB value of #FFF5DEB3 .
Gets a system-defined color that has an ARGB value of #FFFFFFFF .
Gets a system-defined color that has an ARGB value of #FFF5F5F5 .
Gets a system-defined color that has an ARGB value of #FFFFFF00 .
Gets a system-defined color that has an ARGB value of #FF9ACD32 .
Methods
Indicates whether the current object is equal to another object of the same type.
Tests whether the specified object is a Color structure and is equivalent to this Color structure.
Creates a Color structure from a 32-bit ARGB value.
Creates a Color structure from the specified Color structure, but with the new specified alpha value. Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits.
Creates a Color structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.
Creates a Color structure from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits.
Creates a Color structure from the specified predefined color.
Creates a Color structure from the specified name of a predefined color.
Gets the hue-saturation-lightness (HSL) lightness value for this Color structure.
Returns a hash code for this Color structure.
Gets the hue-saturation-lightness (HSL) hue value, in degrees, for this Color structure.
Gets the hue-saturation-lightness (HSL) saturation value for this Color structure.
Gets the 32-bit ARGB value of this Color structure.
Gets the KnownColor value of this Color structure.
Converts this Color structure to a human-readable string.
Operators
Tests whether two specified Color structures are equivalent.
Tests whether two specified Color structures are different.