Color.FromAValues(Single, Single[], Uri) Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Erstellt eine neue Color Struktur mithilfe des angegebenen Alphakanals, Farbkanalwerte und Farbprofils.
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, die die Farbkanäle für die neue Farbe angeben. Diese Werte sind dem profileUri.
- profileUri
- Uri
Das International Color Consortium (ICC) oder das ICM-Farbprofil (Image Color Management) für die neue Farbe.
Gibt zurück
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 Farbprofil des International Color Consortium (ICC) oder des Farbmanagements (Image Color Management, 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. Auf diese Weise kann das Farbsystem, das von einem Computergerät verwendet wird, mit den Farben anderer Anwendungen und Geräte auf demselben oder anderen Computersystem übereinstimmen.