Color.FromAValues(Single, Single[], Uri) Método

Definición

Crea una nueva estructura Color utilizando el canal alfa, los valores de canales de color y el perfil de color especificados.

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

Parámetros

a
Single

Canal alfa para el nuevo color, un valor comprendido entre 0 y 1.

values
Single[]

Colección de valores que especifican los canales de color del nuevo color. Estos valores se asignan a profileUri.

profileUri
Uri

El perfil de color International Color Consortium (ICC) o Image Color Management (ICM) para el nuevo color.

Devoluciones

Color

Estructura Color con los valores especificados.

Ejemplos

En el ejemplo siguiente se muestra cómo usar el FromAValues método para crear una Color estructura.

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

Comentarios

Un perfil de color international Color Consortium (ICC) o Image Color Management (ICM) contiene un perfil de sistema de color para una aplicación o dispositivo determinado, como una impresora de color. Este perfil coincide con un perfil común que, a su vez, se puede asignar a los perfiles individuales de otros dispositivos. Esto permite que el sistema de colores utilizado por un dispositivo informático coincida con los colores de otras aplicaciones y dispositivos en los mismos sistemas informáticos u otros sistemas informáticos.

Se aplica a