Color.B プロパティ
アセンブリ: System.Drawing (system.drawing.dll 内)


Color の G プロパティ、B プロパティ、R プロパティ、A プロパティ、および op_Implicit メンバを使ったコード例を次に示します。
この例は、Windows フォームでの使用を意図してデザインされています。コードをフォームに貼り付け、フォームの Paint イベント処理メソッドから PaintEventArgs の e を渡して ShowPropertiesOfSlateBlue メソッドを呼び出します。
Private Sub ShowPropertiesOfSlateBlue(ByVal e As PaintEventArgs) Dim slateBlue As Color = Color.FromName("SlateBlue") Dim g As Byte = slateBlue.G Dim b As Byte = slateBlue.B Dim r As Byte = slateBlue.R Dim a As Byte = slateBlue.A Dim text As String = _ String.Format("Slate Blue has these ARGB values: Alpha:{0}, " _ & "red:{1}, green: {2}, blue {3}", New Object() {a, r, g, b}) e.Graphics.DrawString(text, New Font(Me.Font, FontStyle.Italic), _ New SolidBrush(slateBlue), _ New RectangleF(New PointF(0.0F, 0.0F), _ Size.op_Implicit(Me.Size))) End Sub
private void ShowPropertiesOfSlateBlue(PaintEventArgs e) { Color slateBlue = Color.FromName("SlateBlue"); byte g = slateBlue.G; byte b = slateBlue.B; byte r = slateBlue.R; byte a = slateBlue.A; string text = String.Format("Slate Blue has these ARGB values: Alpha:{0}, " + "red:{1}, green: {2}, blue {3}", new object[]{a, r, g, b}); e.Graphics.DrawString(text, new Font(this.Font, FontStyle.Italic), new SolidBrush(slateBlue), new RectangleF(new PointF(0.0F, 0.0F), this.Size)); }
void ShowPropertiesOfSlateBlue( PaintEventArgs^ e ) { Color slateBlue = Color::FromName( "SlateBlue" ); Byte g = slateBlue.G; Byte b = slateBlue.B; Byte r = slateBlue.R; Byte a = slateBlue.A; array<Object^>^temp0 = {a,r,g,b}; String^ text = String::Format( "Slate Blue has these ARGB values: Alpha:{0}, " "red:{1}, green: {2}, blue {3}", temp0 ); e->Graphics->DrawString( text, gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), gcnew SolidBrush( slateBlue ), RectangleF(PointF(0.0F,0.0F),this->Size) ); }
private void ShowPropertiesOfSlateBlue(PaintEventArgs e) { Color slateBlue = Color.FromName("SlateBlue"); ubyte g = slateBlue.get_G(); ubyte b = slateBlue.get_B(); ubyte r = slateBlue.get_R(); ubyte a = slateBlue.get_A(); String text = String.Format( "Slate Blue has these ARGB values: Alpha:{0}, " + "red:{1}, green: {2}, blue {3}", new Object[] { (UInt16)a, (UInt16)r, (UInt16)g, (UInt16)b }); e.get_Graphics().DrawString(text, new Font(this.get_Font(), FontStyle.Italic), new SolidBrush(slateBlue), new RectangleF(new PointF(0, 0), Size.op_Implicit(this.get_Size()))); } //ShowPropertiesOfSlateBlue

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からColor.B プロパティを検索する場合は、下記のリンクをクリックしてください。

- Color.B プロパティのページへのリンク