Brushes Brushes Brushes Brushes Class

Definition

Brushes for all the standard colors. This class cannot be inherited.

public ref class Brushes sealed
public sealed class Brushes
type Brushes = class
Public NotInheritable Class Brushes
Inheritance
BrushesBrushesBrushesBrushes

Examples

The following code example demonstrates the how to use a member of the Brushes class to fill a Rectangle. This example should be used with a Windows Form. Paste this code into a form and call this method when handling the form's Paint event, passing e as PaintEventArgs.

private:
   void InstanceRectangleIntersection( PaintEventArgs^ e )
   {
      Rectangle rectangle1 = Rectangle(50,50,200,100);
      Rectangle rectangle2 = Rectangle(70,20,100,200);
      e->Graphics->DrawRectangle( Pens::Black, rectangle1 );
      e->Graphics->DrawRectangle( Pens::Red, rectangle2 );
      if ( rectangle1.IntersectsWith( rectangle2 ) )
      {
         rectangle1.Intersect( rectangle2 );
         if (  !rectangle1.IsEmpty )
         {
            e->Graphics->FillRectangle( Brushes::Green, rectangle1 );
         }
      }
   }
private void InstanceRectangleIntersection(PaintEventArgs e)
{

    Rectangle rectangle1 = new Rectangle(50, 50, 200, 100);
    Rectangle rectangle2 = new Rectangle(70, 20, 100, 200);

    e.Graphics.DrawRectangle(Pens.Black, rectangle1);
    e.Graphics.DrawRectangle(Pens.Red, rectangle2);

    if (rectangle1.IntersectsWith(rectangle2))
    {
        rectangle1.Intersect(rectangle2);
        if (!rectangle1.IsEmpty)
        {
            e.Graphics.FillRectangle(Brushes.Green, rectangle1);
        }
    }
}
Private Sub InstanceRectangleIntersection( _
    ByVal e As PaintEventArgs)

    Dim rectangle1 As New Rectangle(50, 50, 200, 100)
    Dim rectangle2 As New Rectangle(70, 20, 100, 200)

    e.Graphics.DrawRectangle(Pens.Black, rectangle1)
    e.Graphics.DrawRectangle(Pens.Red, rectangle2)

    If (rectangle1.IntersectsWith(rectangle2)) Then
        rectangle1.Intersect(rectangle2)
        If Not (rectangle1.IsEmpty) Then
            e.Graphics.FillRectangle(Brushes.Green, rectangle1)
        End If
    End If
End Sub

Remarks

The Brushes class contains static read-only properties that return a Brush object of the color indicated by the property name. You typically do not have to explicitly dispose of the brush returned by a property in this class, unless it is used to construct a new brush. For more information about the colors represented by the brushes in this class, see Colors by Name.

Properties

AliceBlue AliceBlue AliceBlue AliceBlue

Gets a system-defined Brush object.

AntiqueWhite AntiqueWhite AntiqueWhite AntiqueWhite

Gets a system-defined Brush object.

Aqua Aqua Aqua Aqua

Gets a system-defined Brush object.

Aquamarine Aquamarine Aquamarine Aquamarine

Gets a system-defined Brush object.

Azure Azure Azure Azure

Gets a system-defined Brush object.

Beige Beige Beige Beige

Gets a system-defined Brush object.

Bisque Bisque Bisque Bisque

Gets a system-defined Brush object.

Black Black Black Black

Gets a system-defined Brush object.

BlanchedAlmond BlanchedAlmond BlanchedAlmond BlanchedAlmond

Gets a system-defined Brush object.

Blue Blue Blue Blue

Gets a system-defined Brush object.

BlueViolet BlueViolet BlueViolet BlueViolet

Gets a system-defined Brush object.

Brown Brown Brown Brown

Gets a system-defined Brush object.

BurlyWood BurlyWood BurlyWood BurlyWood

Gets a system-defined Brush object.

CadetBlue CadetBlue CadetBlue CadetBlue

Gets a system-defined Brush object.

Chartreuse Chartreuse Chartreuse Chartreuse

Gets a system-defined Brush object.

Chocolate Chocolate Chocolate Chocolate

Gets a system-defined Brush object.

Coral Coral Coral Coral

Gets a system-defined Brush object.

CornflowerBlue CornflowerBlue CornflowerBlue CornflowerBlue

Gets a system-defined Brush object.

Cornsilk Cornsilk Cornsilk Cornsilk

Gets a system-defined Brush object.

Crimson Crimson Crimson Crimson

Gets a system-defined Brush object.

Cyan Cyan Cyan Cyan

Gets a system-defined Brush object.

DarkBlue DarkBlue DarkBlue DarkBlue

Gets a system-defined Brush object.

DarkCyan DarkCyan DarkCyan DarkCyan

Gets a system-defined Brush object.

DarkGoldenrod DarkGoldenrod DarkGoldenrod DarkGoldenrod

Gets a system-defined Brush object.

DarkGray DarkGray DarkGray DarkGray

Gets a system-defined Brush object.

DarkGreen DarkGreen DarkGreen DarkGreen

Gets a system-defined Brush object.

DarkKhaki DarkKhaki DarkKhaki DarkKhaki

Gets a system-defined Brush object.

DarkMagenta DarkMagenta DarkMagenta DarkMagenta

Gets a system-defined Brush object.

DarkOliveGreen DarkOliveGreen DarkOliveGreen DarkOliveGreen

Gets a system-defined Brush object.

DarkOrange DarkOrange DarkOrange DarkOrange

Gets a system-defined Brush object.

DarkOrchid DarkOrchid DarkOrchid DarkOrchid

Gets a system-defined Brush object.

DarkRed DarkRed DarkRed DarkRed

Gets a system-defined Brush object.

DarkSalmon DarkSalmon DarkSalmon DarkSalmon

Gets a system-defined Brush object.

DarkSeaGreen DarkSeaGreen DarkSeaGreen DarkSeaGreen

Gets a system-defined Brush object.

DarkSlateBlue DarkSlateBlue DarkSlateBlue DarkSlateBlue

Gets a system-defined Brush object.

DarkSlateGray DarkSlateGray DarkSlateGray DarkSlateGray

Gets a system-defined Brush object.

DarkTurquoise DarkTurquoise DarkTurquoise DarkTurquoise

Gets a system-defined Brush object.

DarkViolet DarkViolet DarkViolet DarkViolet

Gets a system-defined Brush object.

DeepPink DeepPink DeepPink DeepPink

Gets a system-defined Brush object.

DeepSkyBlue DeepSkyBlue DeepSkyBlue DeepSkyBlue

Gets a system-defined Brush object.

DimGray DimGray DimGray DimGray

Gets a system-defined Brush object.

DodgerBlue DodgerBlue DodgerBlue DodgerBlue

Gets a system-defined Brush object.

Firebrick Firebrick Firebrick Firebrick

Gets a system-defined Brush object.

FloralWhite FloralWhite FloralWhite FloralWhite

Gets a system-defined Brush object.

ForestGreen ForestGreen ForestGreen ForestGreen

Gets a system-defined Brush object.

Fuchsia Fuchsia Fuchsia Fuchsia

Gets a system-defined Brush object.

Gainsboro Gainsboro Gainsboro Gainsboro

Gets a system-defined Brush object.

GhostWhite GhostWhite GhostWhite GhostWhite

Gets a system-defined Brush object.

Gold Gold Gold Gold

Gets a system-defined Brush object.

Goldenrod Goldenrod Goldenrod Goldenrod

Gets a system-defined Brush object.

Gray Gray Gray Gray

Gets a system-defined Brush object.

Green Green Green Green

Gets a system-defined Brush object.

GreenYellow GreenYellow GreenYellow GreenYellow

Gets a system-defined Brush object.

Honeydew Honeydew Honeydew Honeydew

Gets a system-defined Brush object.

HotPink HotPink HotPink HotPink

Gets a system-defined Brush object.

IndianRed IndianRed IndianRed IndianRed

Gets a system-defined Brush object.

Indigo Indigo Indigo Indigo

Gets a system-defined Brush object.

Ivory Ivory Ivory Ivory

Gets a system-defined Brush object.

Khaki Khaki Khaki Khaki

Gets a system-defined Brush object.

Lavender Lavender Lavender Lavender

Gets a system-defined Brush object.

LavenderBlush LavenderBlush LavenderBlush LavenderBlush

Gets a system-defined Brush object.

LawnGreen LawnGreen LawnGreen LawnGreen

Gets a system-defined Brush object.

LemonChiffon LemonChiffon LemonChiffon LemonChiffon

Gets a system-defined Brush object.

LightBlue LightBlue LightBlue LightBlue

Gets a system-defined Brush object.

LightCoral LightCoral LightCoral LightCoral

Gets a system-defined Brush object.

LightCyan LightCyan LightCyan LightCyan

Gets a system-defined Brush object.

LightGoldenrodYellow LightGoldenrodYellow LightGoldenrodYellow LightGoldenrodYellow

Gets a system-defined Brush object.

LightGray LightGray LightGray LightGray

Gets a system-defined Brush object.

LightGreen LightGreen LightGreen LightGreen

Gets a system-defined Brush object.

LightPink LightPink LightPink LightPink

Gets a system-defined Brush object.

LightSalmon LightSalmon LightSalmon LightSalmon

Gets a system-defined Brush object.

LightSeaGreen LightSeaGreen LightSeaGreen LightSeaGreen

Gets a system-defined Brush object.

LightSkyBlue LightSkyBlue LightSkyBlue LightSkyBlue

Gets a system-defined Brush object.

LightSlateGray LightSlateGray LightSlateGray LightSlateGray

Gets a system-defined Brush object.

LightSteelBlue LightSteelBlue LightSteelBlue LightSteelBlue

Gets a system-defined Brush object.

LightYellow LightYellow LightYellow LightYellow

Gets a system-defined Brush object.

Lime Lime Lime Lime

Gets a system-defined Brush object.

LimeGreen LimeGreen LimeGreen LimeGreen

Gets a system-defined Brush object.

Linen Linen Linen Linen

Gets a system-defined Brush object.

Magenta Magenta Magenta Magenta

Gets a system-defined Brush object.

Maroon Maroon Maroon Maroon

Gets a system-defined Brush object.

MediumAquamarine MediumAquamarine MediumAquamarine MediumAquamarine

Gets a system-defined Brush object.

MediumBlue MediumBlue MediumBlue MediumBlue

Gets a system-defined Brush object.

MediumOrchid MediumOrchid MediumOrchid MediumOrchid

Gets a system-defined Brush object.

MediumPurple MediumPurple MediumPurple MediumPurple

Gets a system-defined Brush object.

MediumSeaGreen MediumSeaGreen MediumSeaGreen MediumSeaGreen

Gets a system-defined Brush object.

MediumSlateBlue MediumSlateBlue MediumSlateBlue MediumSlateBlue

Gets a system-defined Brush object.

MediumSpringGreen MediumSpringGreen MediumSpringGreen MediumSpringGreen

Gets a system-defined Brush object.

MediumTurquoise MediumTurquoise MediumTurquoise MediumTurquoise

Gets a system-defined Brush object.

MediumVioletRed MediumVioletRed MediumVioletRed MediumVioletRed

Gets a system-defined Brush object.

MidnightBlue MidnightBlue MidnightBlue MidnightBlue

Gets a system-defined Brush object.

MintCream MintCream MintCream MintCream

Gets a system-defined Brush object.

MistyRose MistyRose MistyRose MistyRose

Gets a system-defined Brush object.

Moccasin Moccasin Moccasin Moccasin

Gets a system-defined Brush object.

NavajoWhite NavajoWhite NavajoWhite NavajoWhite

Gets a system-defined Brush object.

Navy Navy Navy Navy

Gets a system-defined Brush object.

OldLace OldLace OldLace OldLace

Gets a system-defined Brush object.

Olive Olive Olive Olive

Gets a system-defined Brush object.

OliveDrab OliveDrab OliveDrab OliveDrab

Gets a system-defined Brush object.

Orange Orange Orange Orange

Gets a system-defined Brush object.

OrangeRed OrangeRed OrangeRed OrangeRed

Gets a system-defined Brush object.

Orchid Orchid Orchid Orchid

Gets a system-defined Brush object.

PaleGoldenrod PaleGoldenrod PaleGoldenrod PaleGoldenrod

Gets a system-defined Brush object.

PaleGreen PaleGreen PaleGreen PaleGreen

Gets a system-defined Brush object.

PaleTurquoise PaleTurquoise PaleTurquoise PaleTurquoise

Gets a system-defined Brush object.

PaleVioletRed PaleVioletRed PaleVioletRed PaleVioletRed

Gets a system-defined Brush object.

PapayaWhip PapayaWhip PapayaWhip PapayaWhip

Gets a system-defined Brush object.

PeachPuff PeachPuff PeachPuff PeachPuff

Gets a system-defined Brush object.

Peru Peru Peru Peru

Gets a system-defined Brush object.

Pink Pink Pink Pink

Gets a system-defined Brush object.

Plum Plum Plum Plum

Gets a system-defined Brush object.

PowderBlue PowderBlue PowderBlue PowderBlue

Gets a system-defined Brush object.

Purple Purple Purple Purple

Gets a system-defined Brush object.

Red Red Red Red

Gets a system-defined Brush object.

RosyBrown RosyBrown RosyBrown RosyBrown

Gets a system-defined Brush object.

RoyalBlue RoyalBlue RoyalBlue RoyalBlue

Gets a system-defined Brush object.

SaddleBrown SaddleBrown SaddleBrown SaddleBrown

Gets a system-defined Brush object.

Salmon Salmon Salmon Salmon

Gets a system-defined Brush object.

SandyBrown SandyBrown SandyBrown SandyBrown

Gets a system-defined Brush object.

SeaGreen SeaGreen SeaGreen SeaGreen

Gets a system-defined Brush object.

SeaShell SeaShell SeaShell SeaShell

Gets a system-defined Brush object.

Sienna Sienna Sienna Sienna

Gets a system-defined Brush object.

Silver Silver Silver Silver

Gets a system-defined Brush object.

SkyBlue SkyBlue SkyBlue SkyBlue

Gets a system-defined Brush object.

SlateBlue SlateBlue SlateBlue SlateBlue

Gets a system-defined Brush object.

SlateGray SlateGray SlateGray SlateGray

Gets a system-defined Brush object.

Snow Snow Snow Snow

Gets a system-defined Brush object.

SpringGreen SpringGreen SpringGreen SpringGreen

Gets a system-defined Brush object.

SteelBlue SteelBlue SteelBlue SteelBlue

Gets a system-defined Brush object.

Tan Tan Tan Tan

Gets a system-defined Brush object.

Teal Teal Teal Teal

Gets a system-defined Brush object.

Thistle Thistle Thistle Thistle

Gets a system-defined Brush object.

Tomato Tomato Tomato Tomato

Gets a system-defined Brush object.

Transparent Transparent Transparent Transparent

Gets a system-defined Brush object.

Turquoise Turquoise Turquoise Turquoise

Gets a system-defined Brush object.

Violet Violet Violet Violet

Gets a system-defined Brush object.

Wheat Wheat Wheat Wheat

Gets a system-defined Brush object.

White White White White

Gets a system-defined Brush object.

WhiteSmoke WhiteSmoke WhiteSmoke WhiteSmoke

Gets a system-defined Brush object.

Yellow Yellow Yellow Yellow

Gets a system-defined Brush object.

YellowGreen YellowGreen YellowGreen YellowGreen

Gets a system-defined Brush object.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to