Color.FromValues(Single[], Uri) Methode

Definitie

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

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

Parameters

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 en een alfakanaalwaarde van 1.

Voorbeelden

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

private Color FromValuesExample()
{
    // Create a brown color using the FromValues static method.
    Color myValuesColor = 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 myIccUri = new Uri("C:\\sampleColorProfile.icc");

    // The values given by the first parameter are used with the color 
    // profile specified by the second parameter to determine the color.
    myValuesColor = Color.FromValues(colorValues, myIccUri);
    return myValuesColor;
}
Private Function FromValuesExample() As Color
    ' Create a brown color using the FromValues static method.
    Dim myValuesColor 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 myIccUri As New Uri("C:\sampleColorProfile.icc")

    ' The values given by the first parameter are used with the color 
    ' profile specified by the second parameter to determine the color.
    myValuesColor = Color.FromValues(colorValues, myIccUri)
    Return myValuesColor
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