Brushes 類別

定義

所有標準色彩的筆刷。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
繼承
Brushes

範例

下列程式碼範例示範如何使用Brushes類別的成員來Rectangle填滿。The following code example demonstrates the how to use a member of the Brushes class to fill a Rectangle. 這個範例應該與 Windows Form 搭配使用。This example should be used with a Windows Form. 將此程式碼貼入表單, 並在處理表單的Paint事件時呼叫這個方法, 傳遞ePaintEventArgsPaste 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

備註

類別包含static唯讀屬性, 可Brush傳回屬性名稱所指定之色彩的物件。 BrushesThe 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.

屬性

AliceBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

AntiqueWhite

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Aqua

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Aquamarine

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Azure

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Beige

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Bisque

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Black

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

BlanchedAlmond

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Blue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

BlueViolet

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Brown

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

BurlyWood

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

CadetBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Chartreuse

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Chocolate

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Coral

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

CornflowerBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Cornsilk

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Crimson

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Cyan

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkCyan

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkGoldenrod

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkGray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkKhaki

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkMagenta

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkOliveGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkOrange

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkOrchid

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkRed

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkSalmon

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkSeaGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkSlateBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkSlateGray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkTurquoise

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DarkViolet

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DeepPink

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DeepSkyBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DimGray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

DodgerBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Firebrick

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

FloralWhite

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

ForestGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Fuchsia

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Gainsboro

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

GhostWhite

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Gold

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Goldenrod

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Gray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Green

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

GreenYellow

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Honeydew

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

HotPink

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

IndianRed

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Indigo

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Ivory

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Khaki

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Lavender

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LavenderBlush

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LawnGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LemonChiffon

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightCoral

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightCyan

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightGoldenrodYellow

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightGray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightPink

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightSalmon

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightSeaGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightSkyBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightSlateGray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightSteelBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LightYellow

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Lime

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

LimeGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Linen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Magenta

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Maroon

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumAquamarine

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumOrchid

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumPurple

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumSeaGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumSlateBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumSpringGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumTurquoise

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MediumVioletRed

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MidnightBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MintCream

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

MistyRose

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Moccasin

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

NavajoWhite

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Navy

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

OldLace

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Olive

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

OliveDrab

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Orange

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

OrangeRed

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Orchid

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PaleGoldenrod

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PaleGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PaleTurquoise

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PaleVioletRed

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PapayaWhip

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PeachPuff

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Peru

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Pink

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Plum

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

PowderBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Purple

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Red

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

RosyBrown

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

RoyalBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SaddleBrown

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Salmon

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SandyBrown

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SeaGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SeaShell

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Sienna

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Silver

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SkyBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SlateBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SlateGray

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Snow

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SpringGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

SteelBlue

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Tan

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Teal

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Thistle

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Tomato

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Transparent

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Turquoise

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Violet

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Wheat

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

White

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

WhiteSmoke

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

Yellow

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

YellowGreen

取得系統定義的 Brush 物件。Gets a system-defined Brush object.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於