Color.FromArgb(Byte, Byte, Byte, Byte) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new Color structure by using the specified sRGB
alpha channel and color channel values.
public:
static System::Windows::Media::Color FromArgb(System::Byte a, System::Byte r, System::Byte g, System::Byte b);
public static System.Windows.Media.Color FromArgb (byte a, byte r, byte g, byte b);
static member FromArgb : byte * byte * byte * byte -> System.Windows.Media.Color
Public Shared Function FromArgb (a As Byte, r As Byte, g As Byte, b As Byte) As Color
Parameters
Returns
A Color structure with the specified values.
Examples
private Color FromArgbExample()
{
// Create a blue color using the FromArgb static method.
Color myArgbColor = new Color();
myArgbColor = Color.FromArgb(255, 0, 255, 0);
return myArgbColor;
}
Private Function FromArgbExample() As Color
' Create a blue color using the FromArgb static method.
Dim myArgbColor As New Color()
myArgbColor = Color.FromArgb(255, 0, 255, 0)
Return myArgbColor
End Function
Remarks
The FromArgb method allows you to specify the alpha channel; the FromRgb method uses a default value of 255 for the alpha channel.
The alpha channel of a color determines the amount of transparency of the color. An alpha value of 255 indicates that the color is completely opaque, and a value of 0 indicates that the color is completely transparent.
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應