Color.FromArgb 메서드

정의

네 개의 8비트 ARGB 구성 요소(알파, 빨강, 녹색 및 파랑) 값으로 Color 구조체를 만듭니다.

오버로드

FromArgb(Int32, Int32, Int32, Int32)

네 개의 ARGB 구성 요소(알파, 빨강, 녹색 및 파랑) 값으로 Color 구조체를 만듭니다. 이 메서드에서 각각의 구성 요소를 32비트 값으로 전달할 수 있으나, 각 구성 요소의 값은 8비트로 제한됩니다.

FromArgb(Int32, Int32, Int32)

지정된 8비트 값(빨강, 녹색 및 파랑)으로 Color 구조체를 만듭니다. 암시적으로 알파 값은 255(완전 불투명)입니다. 이 메서드에서 각각의 색 구성 요소를 32비트 값으로 전달할 수 있으나, 각 구성 요소의 값은 8비트로 제한됩니다.

FromArgb(Int32, Color)

지정된 Color 구조체에에서 Color 구조체를 만들지만, 알파 값을 새로 지정합니다. 이 메서드에서 알파 값을 32비트 값으로 전달할 수 있으나, 이 값은 8비트로 제한됩니다.

FromArgb(Int32)

32비트 ARGB 값으로 Color 구조체를 만듭니다.

FromArgb(Int32, Int32, Int32, Int32)

네 개의 ARGB 구성 요소(알파, 빨강, 녹색 및 파랑) 값으로 Color 구조체를 만듭니다. 이 메서드에서 각각의 구성 요소를 32비트 값으로 전달할 수 있으나, 각 구성 요소의 값은 8비트로 제한됩니다.

public:
 static System::Drawing::Color FromArgb(int alpha, int red, int green, int blue);
public static System.Drawing.Color FromArgb (int alpha, int red, int green, int blue);
static member FromArgb : int * int * int * int -> System.Drawing.Color
Public Shared Function FromArgb (alpha As Integer, red As Integer, green As Integer, blue As Integer) As Color

매개 변수

alpha
Int32

알파 구성 요소입니다. 유효한 값은 0부터 255까지입니다.

red
Int32

빨강 구성 요소입니다. 유효한 값은 0부터 255까지입니다.

green
Int32

녹색 구성 요소입니다. 유효한 값은 0부터 255까지입니다.

blue
Int32

파랑 구성 요소입니다. 유효한 값은 0부터 255까지입니다.

반환

이 메서드가 만드는 Color입니다.

예외

alpha, red, green 또는 blue가 0보다 작거나 255보다 큰 경우

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 각각 다른 색으로 세 개의 브러시를 만듭니다. 브러시를 만드는 데 사용되는 각 Color 구조체는 네 가지 구성 요소 값(알파, 빨강, 녹색, 파랑)으로 만들어집니다.

  • 가상 삼각형을 사용하여 세 개의 원을 배치합니다.

  • 각 원에 대해 다른 브러시를 사용하여 삼각형의 한 꼭짓점을 중심으로 세 개의 겹치는 원을 그립니다.

void FromArgb1( PaintEventArgs^ e )
{
   Graphics^ g = e->Graphics;

   // Transparent red, green, and blue brushes.
   SolidBrush^ trnsRedBrush = gcnew SolidBrush( Color::FromArgb( 120, 255, 0, 0 ) );
   SolidBrush^ trnsGreenBrush = gcnew SolidBrush( Color::FromArgb( 120, 0, 255, 0 ) );
   SolidBrush^ trnsBlueBrush = gcnew SolidBrush( Color::FromArgb( 120, 0, 0, 255 ) );

   // Base and height of the triangle that is used to position the
   // circles. Each vertex of the triangle is at the center of one of the
   // 3 circles. The base is equal to the diameter of the circles.
   float triBase = 100;
   float triHeight = (float)Math::Sqrt( 3 * (triBase * triBase) / 4 );

   // Coordinates of first circle's bounding rectangle.
   float x1 = 40;
   float y1 = 40;

   // Fill 3 over-lapping circles. Each circle is a different color.
   g->FillEllipse( trnsRedBrush, x1, y1, 2 * triHeight, 2 * triHeight );
   g->FillEllipse( trnsGreenBrush, x1 + triBase / 2, y1 + triHeight, 2 * triHeight, 2 * triHeight );
   g->FillEllipse( trnsBlueBrush, x1 + triBase, y1, 2 * triHeight, 2 * triHeight );
}
public void FromArgb1(PaintEventArgs e)
{
    Graphics     g = e.Graphics;
             
    // Transparent red, green, and blue brushes.
    SolidBrush trnsRedBrush = new SolidBrush(Color.FromArgb(120, 255, 0, 0));
    SolidBrush trnsGreenBrush = new SolidBrush(Color.FromArgb(120, 0, 255, 0));
    SolidBrush trnsBlueBrush = new SolidBrush(Color.FromArgb(120, 0, 0, 255));
             
    // Base and height of the triangle that is used to position the
    // circles. Each vertex of the triangle is at the center of one of the
    // 3 circles. The base is equal to the diameter of the circles.
    float   triBase = 100;
    float   triHeight = (float)Math.Sqrt(3*(triBase*triBase)/4);
             
    // Coordinates of first circle's bounding rectangle.
    float   x1 = 40;
    float   y1 = 40;
             
    // Fill 3 over-lapping circles. Each circle is a different color.
    g.FillEllipse(trnsRedBrush, x1, y1, 2*triHeight, 2*triHeight);
    g.FillEllipse(trnsGreenBrush, x1 + triBase/2, y1 + triHeight,
        2*triHeight, 2*triHeight);
    g.FillEllipse(trnsBlueBrush, x1 + triBase, y1, 2*triHeight, 2*triHeight);
}
Public Sub FromArgb1(ByVal e As PaintEventArgs)
    Dim g As Graphics = e.Graphics

    ' Transparent red, green, and blue brushes.
    Dim trnsRedBrush As New SolidBrush(Color.FromArgb(120, 255, 0, 0))
    Dim trnsGreenBrush As New SolidBrush(Color.FromArgb(120, 0, _
    255, 0))
    Dim trnsBlueBrush As New SolidBrush(Color.FromArgb(120, 0, 0, 255))

    ' Base and height of the triangle that is used to position the
    ' circles. Each vertex of the triangle is at the center of one of
    ' the 3 circles. The base is equal to the diameter of the circle.
    Dim triBase As Single = 100
    Dim triHeight As Single = CSng(Math.Sqrt((3 * (triBase * _
    triBase) / 4)))

    ' Coordinates of first circle's bounding rectangle.
    Dim x1 As Single = 40
    Dim y1 As Single = 40

    ' Fill 3 over-lapping circles. Each circle is a different color.
    g.FillEllipse(trnsRedBrush, x1, y1, 2 * triHeight, 2 * triHeight)
    g.FillEllipse(trnsGreenBrush, x1 + triBase / 2, y1 + triHeight, _
    2 * triHeight, 2 * triHeight)
    g.FillEllipse(trnsBlueBrush, x1 + triBase, y1, 2 * triHeight, _
    2 * triHeight)
End Sub

설명

불투명 색을 만들려면 를 255로 설정합니다 alpha . 반투명 색을 만들려면 를 1에서 254까지의 값으로 설정합니다 alpha .

적용 대상

FromArgb(Int32, Int32, Int32)

지정된 8비트 값(빨강, 녹색 및 파랑)으로 Color 구조체를 만듭니다. 암시적으로 알파 값은 255(완전 불투명)입니다. 이 메서드에서 각각의 색 구성 요소를 32비트 값으로 전달할 수 있으나, 각 구성 요소의 값은 8비트로 제한됩니다.

public:
 static System::Drawing::Color FromArgb(int red, int green, int blue);
public static System.Drawing.Color FromArgb (int red, int green, int blue);
static member FromArgb : int * int * int -> System.Drawing.Color
Public Shared Function FromArgb (red As Integer, green As Integer, blue As Integer) As Color

매개 변수

red
Int32

Color의 빨강 구성 요소 값입니다. 유효한 값은 0부터 255까지입니다.

green
Int32

Color의 녹색 구성 요소 값입니다. 유효한 값은 0부터 255까지입니다.

blue
Int32

Color의 파랑 구성 요소 값입니다. 유효한 값은 0부터 255까지입니다.

반환

이 메서드가 만드는 Color입니다.

예외

red, green 또는 blue가 0보다 작거나 255보다 큰 경우

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  1. 세 가지 색 구성 요소 값(빨강, 녹색, 파랑)에서 구조를 만듭니다 Color . 각 기본 색에 대해 하나씩 세 Color 개의 구조체가 만들어집니다.

  2. 알파 값 범위를 반복하여 색의 알파 값을 변경합니다.

  3. 각 반복 중에 브러시의 색을 수정된 색으로 설정하고 직사각형을 그려 색을 표시합니다.

  4. 각 기본 색에 대해 2단계와 3단계를 반복합니다.

알파 값은 완전히 불투명하지 않으며 사각형이 겹치므로 색 조합 효과를 얻을 수 있습니다.

void FromArgb2( PaintEventArgs^ e )
{
   Graphics^ g = e->Graphics;

   // Opaque colors (alpha value defaults to 255 -- max value).
   Color red = Color::FromArgb( 255, 0, 0 );
   Color green = Color::FromArgb( 0, 255, 0 );
   Color blue = Color::FromArgb( 0, 0, 255 );

   // Solid brush initialized to red.
   SolidBrush^ myBrush = gcnew SolidBrush( red );
   int alpha;

   // x coordinate of first red rectangle
   int x = 50;

   // y coordinate of first red rectangle
   int y = 50;

   // Fill rectangles with red, varying the alpha value from 25 to 250.
   for ( alpha = 25; alpha <= 250; alpha += 25 )
   {
      myBrush->Color = Color::FromArgb( alpha, red );
      g->FillRectangle( myBrush, x, y, 50, 100 );
      g->FillRectangle( myBrush, x, y + 250, 50, 50 );
      x += 50;
   }
   x = 50;

   // y coordinate of first green rectangle.
   y += 50;

   // Fill rectangles with green, varying the alpha value from 25 to 250.
   for ( alpha = 25; alpha <= 250; alpha += 25 )
   {
      myBrush->Color = Color::FromArgb( alpha, green );
      g->FillRectangle( myBrush, x, y, 50, 150 );
      x += 50;
   }
   x = 50;

   // y coordinate of first blue rectangle.
   y += 100;

   // Fill rectangles with blue, varying the alpha value from 25 to 250.
   for ( alpha = 25; alpha <= 250; alpha += 25 )
   {
      myBrush->Color = Color::FromArgb( alpha, blue );
      g->FillRectangle( myBrush, x, y, 50, 150 );
      x += 50;
   }
}
public void FromArgb2(PaintEventArgs e)
{
    Graphics     g = e.Graphics;
             
    // Opaque colors (alpha value defaults to 255 -- max value).
    Color red = Color.FromArgb(255, 0, 0);
    Color green = Color.FromArgb(0, 255, 0);
    Color blue = Color.FromArgb(0, 0, 255);
             
    // Solid brush initialized to red.
    SolidBrush  myBrush = new SolidBrush(red);
    int alpha;

    // x coordinate of first red rectangle
    int x = 50;         
    
    // y coordinate of first red rectangle
    int y = 50;         
                   
    // Fill rectangles with red, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25)
    {
        myBrush.Color = Color.FromArgb(alpha, red);
        g.FillRectangle(myBrush, x, y, 50, 100);
        g.FillRectangle(myBrush, x, y + 250, 50, 50);
        x += 50;
    }
    // x coordinate of first green rectangle.
    x = 50;             
    
    // y coordinate of first green rectangle.
    y += 50;            
                      
    // Fill rectangles with green, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25)
    {
        myBrush.Color = Color.FromArgb(alpha, green);
        g.FillRectangle(myBrush, x, y, 50, 150);
        x += 50;
    }
    // x coordinate of first blue rectangle.
    x = 50;             
    
    // y coordinate of first blue rectangle.
    y += 100;           
             
    // Fill rectangles with blue, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25)
    {
        myBrush.Color = Color.FromArgb(alpha, blue);
        g.FillRectangle(myBrush, x, y, 50, 150);
        x += 50;
    }
}
Public Sub FromArgb2(ByVal e As PaintEventArgs)
    Dim g As Graphics = e.Graphics

    ' Opaque colors (alpha value defaults to 255 -- max value).
    Dim red As Color = Color.FromArgb(255, 0, 0)
    Dim green As Color = Color.FromArgb(0, 255, 0)
    Dim blue As Color = Color.FromArgb(0, 0, 255)

    ' Solid brush initialized to red.
    Dim myBrush As New SolidBrush(red)
    Dim alpha As Integer

    ' x coordinate of first red rectangle.
    Dim x As Integer = 50

    ' y coordinate of first red rectangle.
    Dim y As Integer = 50

    ' Fill rectangles with red, varying the alpha value from 25 to 250.
    For alpha = 25 To 250 Step 25
        myBrush.Color = Color.FromArgb(alpha, red)
        g.FillRectangle(myBrush, x, y, 50, 100)
        g.FillRectangle(myBrush, x, y + 250, 50, 50)
        x += 50
    Next alpha

    ' x coordinate of first green rectangle.
    x = 50

    ' y coordinate of first green rectangle.
    y += 50


    ' Fill rectangles with green, varying alpha value from 25 to 250.
    For alpha = 25 To 250 Step 25
        myBrush.Color = Color.FromArgb(alpha, green)
        g.FillRectangle(myBrush, x, y, 50, 150)
        x += 50
    Next alpha

    ' x coordinate of first blue rectangle.
    x = 50

    ' y coordinate of first blue rectangle.
    y += 100

    ' Fill rectangles with blue, varying alpha value from 25 to 250.
    For alpha = 25 To 250 Step 25
        myBrush.Color = Color.FromArgb(alpha, blue)
        g.FillRectangle(myBrush, x, y, 50, 150)
        x += 50
    Next alpha
End Sub

적용 대상

FromArgb(Int32, Color)

지정된 Color 구조체에에서 Color 구조체를 만들지만, 알파 값을 새로 지정합니다. 이 메서드에서 알파 값을 32비트 값으로 전달할 수 있으나, 이 값은 8비트로 제한됩니다.

public:
 static System::Drawing::Color FromArgb(int alpha, System::Drawing::Color baseColor);
public static System.Drawing.Color FromArgb (int alpha, System.Drawing.Color baseColor);
static member FromArgb : int * System.Drawing.Color -> System.Drawing.Color
Public Shared Function FromArgb (alpha As Integer, baseColor As Color) As Color

매개 변수

alpha
Int32

Color의 알파 값입니다. 유효한 값은 0부터 255까지입니다.

baseColor
Color

Color을 만들 Color입니다.

반환

이 메서드가 만드는 Color입니다.

예외

alpha가 0보다 작거나 255보다 큽니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  1. 세 가지 색 구성 요소 값(빨강, 녹색, 파랑)에서 구조를 만듭니다 Color . 각 기본 색에 대해 하나씩 세 Color 개의 구조체가 만들어집니다.

  2. 알파 값 범위를 반복하여 색의 알파 값을 변경합니다.

  3. 각 반복 중에 브러시의 색을 수정된 색으로 설정하고 직사각형을 그려 색을 표시합니다.

  4. 각 기본 색에 대해 2단계와 3단계를 반복합니다.

알파 값은 완전히 불투명하지 않으며 사각형이 겹치므로 색 조합 효과를 얻을 수 있습니다.

void FromArgb3( PaintEventArgs^ e )
{
   Graphics^ g = e->Graphics;

   // Opaque colors (alpha value defaults to 255 -- max value).
   Color red = Color::FromArgb( 255, 0, 0 );
   Color green = Color::FromArgb( 0, 255, 0 );
   Color blue = Color::FromArgb( 0, 0, 255 );

   // Solid brush initialized to red.
   SolidBrush^ myBrush = gcnew SolidBrush( red );
   int alpha;

   // x coordinate of first red rectangle
   int x = 50;

   // y coordinate of first red rectangle
   int y = 50;

   // Fill rectangles with red, varying the alpha value from 25 to 250.
   for ( alpha = 25; alpha <= 250; alpha += 25 )
   {
      myBrush->Color = Color::FromArgb( alpha, red );
      g->FillRectangle( myBrush, x, y, 50, 100 );
      g->FillRectangle( myBrush, x, y + 250, 50, 50 );
      x += 50;
   }
   x = 50;

   // y coordinate of first green rectangle
   y += 50;

   // Fill rectangles with green, varying the alpha value from 25 to 250.
   for ( alpha = 25; alpha <= 250; alpha += 25 )
   {
      myBrush->Color = Color::FromArgb( alpha, green );
      g->FillRectangle( myBrush, x, y, 50, 150 );
      x += 50;
   }
   x = 50;

   // y coordinate of first blue rectangle
   y += 100;

   // Fill rectangles with blue, varying the alpha value from 25 to 250.
   for ( alpha = 25; alpha <= 250; alpha += 25 )
   {
      myBrush->Color = Color::FromArgb( alpha, blue );
      g->FillRectangle( myBrush, x, y, 50, 150 );
      x += 50;
   }
}
public void FromArgb3(PaintEventArgs e)
{
    Graphics     g = e.Graphics;
             
    // Opaque colors (alpha value defaults to 255 -- max value).
    Color red = Color.FromArgb(255, 0, 0);
    Color green = Color.FromArgb(0, 255, 0);
    Color blue = Color.FromArgb(0, 0, 255);
             
    // Solid brush initialized to red.
    SolidBrush  myBrush = new SolidBrush(red);
    int alpha;
    
    // x coordinate of first red rectangle
    int x = 50;         
    
    // y coordinate of first red rectangle
    int y = 50;         
    
    // Fill rectangles with red, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25)
    {
        myBrush.Color = Color.FromArgb(alpha, red);
        g.FillRectangle(myBrush, x, y, 50, 100);
        g.FillRectangle(myBrush, x, y + 250, 50, 50);
        x += 50;
    }
    // x coordinate of first green rectangle
    x = 50;             
    
    // y coordinate of first green rectangle
    y += 50;            
    
    // Fill rectangles with green, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25)
    {
        myBrush.Color = Color.FromArgb(alpha, green);
        g.FillRectangle(myBrush, x, y, 50, 150);
        x += 50;
    }
    // x coordinate of first blue rectangle.
    x = 50; 
    
     // y coordinate of first blue rectangle
    y += 100;           

    // Fill rectangles with blue, varying the alpha value from 25 to 250.
    for (alpha = 25; alpha <= 250; alpha += 25)
    {
        myBrush.Color = Color.FromArgb(alpha, blue);
        g.FillRectangle(myBrush, x, y, 50, 150);
        x += 50;
    }
}
Public Sub FromArgb3(ByVal e As PaintEventArgs)
    Dim g As Graphics = e.Graphics

    ' Opaque colors (alpha value defaults to 255 -- max value).
    Dim red As Color = Color.FromArgb(255, 0, 0)
    Dim green As Color = Color.FromArgb(0, 255, 0)
    Dim blue As Color = Color.FromArgb(0, 0, 255)

    ' Solid brush initialized to red.
    Dim myBrush As New SolidBrush(red)
    Dim alpha As Integer

    ' x coordinate of first red rectangle.
    Dim x As Integer = 50

    ' y coordinate of first red rectangle.
    Dim y As Integer = 50

    ' Fill rectangles with red, varying the alpha value from 25 to 250.
    For alpha = 25 To 250 Step 25
        myBrush.Color = Color.FromArgb(alpha, red)
        g.FillRectangle(myBrush, x, y, 50, 100)
        g.FillRectangle(myBrush, x, y + 250, 50, 50)
        x += 50
    Next alpha

    ' x coordinate of first green rectangle.
    x = 50

    ' y coordinate of first green rectangle.
    y += 50

    ' Fill rectangles with green, varying alpha value from 25 to 250.
    For alpha = 25 To 250 Step 25
        myBrush.Color = Color.FromArgb(alpha, green)
        g.FillRectangle(myBrush, x, y, 50, 150)
        x += 50
    Next alpha

    ' x coordinate of first blue rectangle.
    x = 50

    ' y coordinate of first blue rectangle.
    y += 100

    ' Fill rectangles with blue, varying alpha value from 25 to 250.
    For alpha = 25 To 250 Step 25
        myBrush.Color = Color.FromArgb(alpha, blue)
        g.FillRectangle(myBrush, x, y, 50, 150)
        x += 50
    Next alpha
End Sub

설명

불투명 색을 만들려면 를 255로 설정합니다 alpha . 반투명 색을 만들려면 를 1에서 254까지의 값으로 설정합니다 alpha .

적용 대상

FromArgb(Int32)

32비트 ARGB 값으로 Color 구조체를 만듭니다.

public:
 static System::Drawing::Color FromArgb(int argb);
public static System.Drawing.Color FromArgb (int argb);
static member FromArgb : int -> System.Drawing.Color
Public Shared Function FromArgb (argb As Integer) As Color

매개 변수

argb
Int32

32비트ARGB 값을 지정하는 값입니다.

반환

이 메서드가 만드는 Color 구조체를 반환합니다.

예제

다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 처리기의 Paint 매개 변수인 가 필요합니다.PaintEventArgse 코드는 다음 작업을 수행합니다.

  • 각각 다른 색으로 세 개의 브러시를 만듭니다. 브러시를 만드는 데 사용되는 각 Color 구조체는 32비트 ARGB 값으로 만들어집니다.

  • 가상 삼각형을 사용하여 세 개의 원을 배치합니다.

  • 각 원에 대해 다른 브러시를 사용하여 삼각형의 한 꼭짓점을 중심으로 세 개의 겹치는 원을 그립니다.

void FromArgb4( PaintEventArgs^ e )
{
   Graphics^ g = e->Graphics;

   // Transparent red, green, and blue brushes.
   SolidBrush^ trnsRedBrush = gcnew SolidBrush( Color::FromArgb( 0x78FF0000 ) );
   SolidBrush^ trnsGreenBrush = gcnew SolidBrush( Color::FromArgb( 0x7800FF00 ) );
   SolidBrush^ trnsBlueBrush = gcnew SolidBrush( Color::FromArgb( 0x780000FF ) );

   // Base and height of the triangle that is used to position the
   // circles. Each vertex of the triangle is at the center of one of the
   // 3 circles. The base is equal to the diameter of the circles.
   float triBase = 100;
   float triHeight = (float)Math::Sqrt( 3 * (triBase * triBase) / 4 );

   // coordinates of first circle's bounding rectangle.
   float x1 = 40;
   float y1 = 40;

   // Fill 3 over-lapping circles. Each circle is a different color.
   g->FillEllipse( trnsRedBrush, x1, y1, 2 * triHeight, 2 * triHeight );
   g->FillEllipse( trnsGreenBrush, x1 + triBase / 2, y1 + triHeight, 2 * triHeight, 2 * triHeight );
   g->FillEllipse( trnsBlueBrush, x1 + triBase, y1, 2 * triHeight, 2 * triHeight );
}
public void FromArgb4(PaintEventArgs e)
{
    Graphics     g = e.Graphics;
             
    // Transparent red, green, and blue brushes.
    SolidBrush trnsRedBrush = new SolidBrush(Color.FromArgb(0x78FF0000));
    SolidBrush trnsGreenBrush = new SolidBrush(Color.FromArgb(0x7800FF00));
    SolidBrush trnsBlueBrush = new SolidBrush(Color.FromArgb(0x780000FF));
             
    // Base and height of the triangle that is used to position the
    // circles. Each vertex of the triangle is at the center of one of the
    // 3 circles. The base is equal to the diameter of the circles.
    float   triBase = 100;
    float   triHeight = (float)Math.Sqrt(3*(triBase*triBase)/4);
             
    // coordinates of first circle's bounding rectangle.
    float   x1 = 40;
    float   y1 = 40;
             
    // Fill 3 over-lapping circles. Each circle is a different color.
    g.FillEllipse(trnsRedBrush, x1, y1, 2*triHeight, 2*triHeight);
    g.FillEllipse(trnsGreenBrush, x1 + triBase/2, y1 + triHeight,
        2*triHeight, 2*triHeight);
    g.FillEllipse(trnsBlueBrush, x1 + triBase, y1, 2*triHeight, 2*triHeight);
}
Public Sub FromArgb4(ByVal e As PaintEventArgs)
    Dim g As Graphics = e.Graphics

    ' Transparent red, green, and blue brushes.
    Dim trnsRedBrush As New SolidBrush(Color.FromArgb(&H78FF0000))
    Dim trnsGreenBrush As New SolidBrush(Color.FromArgb(&H7800FF00))
    Dim trnsBlueBrush As New SolidBrush(Color.FromArgb(&H780000FF))

    ' Base and height of the triangle that is used to position the
    ' circles. Each vertex of the triangle is at the center of one of
    ' the 3 circles. The base is equal to the diameter of the circle.
    Dim triBase As Single = 100
    Dim triHeight As Single = CSng(Math.Sqrt((3 * (triBase * _
    triBase) / 4)))

    ' Coordinates of first circle
    's bounding rectangle.
    Dim x1 As Single = 40
    Dim y1 As Single = 40

    ' Fill 3 over-lapping circles. Each circle is a different color.
    g.FillEllipse(trnsRedBrush, x1, y1, 2 * triHeight, 2 * triHeight)
    g.FillEllipse(trnsGreenBrush, x1 + triBase / 2, y1 + triHeight, _
    2 * triHeight, 2 * triHeight)
    g.FillEllipse(trnsBlueBrush, x1 + triBase, y1, 2 * triHeight, _
    2 * triHeight)
End Sub

설명

32비트 ARGB 값의 바이트 순서는 AARRGGBB입니다. AA로 표시되는 가장 중요한 바이트(MSB)는 알파 구성 요소 값입니다. 각각 RR, GG 및 BB로 표현되는 두 번째, 세 번째 및 네 번째 바이트는 각각 빨간색, 녹색 및 파랑 색 구성 요소입니다.

적용 대상