Color.FromAValues(Single, Single[], Uri) Methode

Definition

Erstellt mithilfe der angegebenen Alphakanal- und Farbkanalwerte sowie des angegebenen Farbprofils eine neue Color-Struktur.

public:
 static System::Windows::Media::Color FromAValues(float a, cli::array <float> ^ values, Uri ^ profileUri);
public static System.Windows.Media.Color FromAValues (float a, float[] values, Uri profileUri);
static member FromAValues : single * single[] * Uri -> System.Windows.Media.Color
Public Shared Function FromAValues (a As Single, values As Single(), profileUri As Uri) As Color

Parameter

a
Single

Der Alphakanal für die neue Farbe, ein Wert zwischen 0 und 1.

values
Single[]

Eine Auflistung von Werten, mit denen die Farbkanäle für die neue Farbe angegeben werden. Diese Werte sind dem profileUri zugeordnet.

profileUri
Uri

Das Internationale Farbkonsortium (ICC) oder das Farbverwaltungsprofil (ICM) für die neue Farbe.

Gibt zurück

Color

Eine Color-Struktur mit den angegebenen Werten.

Beispiele

Das folgende Beispiel zeigt, wie Sie die FromAValues Methode zum Erstellen einer Color Struktur verwenden.

private Color FromAValuesExample()
{
    // Create a brown color using the FromAValues static method.
    Color myAValuesColor = new Color();
    float [] colorValues = new float[4];
    colorValues[0] = 0.0f;
    colorValues[1] = 0.5f;
    colorValues[2] = 0.5f;
    colorValues[3] = 0.5f;

    // Uri to sample color profile. This color profile is used to 
    // determine what the colors the colorValues map to.
    Uri iccUri = new Uri("C:\\sampleColorProfile.icc");

    // The FromAValues method requires an explicit value for alpha
    // (first parameter). The values given by the second parameter are
    // used with the color profile specified by the third parameter to 
    // determine the color.
    myAValuesColor = Color.FromAValues(1.0f, colorValues, iccUri);
    return myAValuesColor;
}
Private Function FromAValuesExample() As Color
    ' Create a brown color using the FromAValues static method.
    Dim myAValuesColor As New Color()
    Dim colorValues(3) As Single
    colorValues(0) = 0.0f
    colorValues(1) = 0.5f
    colorValues(2) = 0.5f
    colorValues(3) = 0.5f

    ' Uri to sample color profile. This color profile is used to 
    ' determine what the colors the colorValues map to.
    Dim iccUri As New Uri("C:\sampleColorProfile.icc")

    ' The FromAValues method requires an explicit value for alpha
    ' (first parameter). The values given by the second parameter are
    ' used with the color profile specified by the third parameter to 
    ' determine the color.
    myAValuesColor = Color.FromAValues(1.0f, colorValues, iccUri)
    Return myAValuesColor
End Function

Hinweise

Ein Internationales Farbkonsortium (ICC) oder ein Farbverwaltungsprofil (ICM) enthält ein Farbsystemprofil für eine bestimmte Anwendung oder ein bestimmtes Gerät, z. B. einen Farbdrucker. Dieses Profil wird mit einem gemeinsamen Profil abgeglichen, das wiederum den einzelnen Profilen anderer Geräte zugeordnet werden kann. Dadurch kann das farbsystem, das von einem Computergerät verwendet wird, mit den Farben anderer Anwendungen und Geräte auf demselben oder anderen Computersystem übereinstimmen.

Gilt für