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

Definitie

Hiermee maakt u een nieuwe Color structuur met behulp van het opgegeven alfakanaal, kleurkanaalwaarden en kleurprofiel.

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

Parameters

a
Single

Het alfakanaal voor de nieuwe kleur, een waarde tussen 0 en 1.

values
Single[]

Een verzameling waarden waarmee de kleurkanalen voor de nieuwe kleur worden opgegeven. Deze waarden zijn toegewezen aan de profileUri.

profileUri
Uri

Het ICM-kleurenprofiel (International Color Consortium) of Image Color Management (ICM) voor de nieuwe kleur.

Retouren

Een Color structuur met de opgegeven waarden.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de FromAValues methode gebruikt om een Color structuur te maken.

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

Opmerkingen

Een ICM-kleurenprofiel (International Color Consortium) of Image Color Management (ICM) bevat een kleurensysteemprofiel voor een bepaalde toepassing of een bepaald apparaat, zoals een kleurenprinter. Dit profiel wordt gekoppeld aan een gemeenschappelijk profiel dat op zijn beurt kan worden toegewezen aan de afzonderlijke profielen van andere apparaten. Hierdoor kan het kleurensysteem dat door het ene computerapparaat wordt gebruikt, overeenkomen met de kleuren van andere toepassingen en apparaten op dezelfde of andere computersystemen.

Van toepassing op