Aracılığıyla paylaş


Color.FromAValues(Single, Single[], Uri) Yöntem

Tanım

Belirtilen alfa kanalını, renk kanalı değerlerini ve renk profilini kullanarak yeni Color bir yapı oluşturur.

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

Parametreler

a
Single

Yeni renk için alfa kanalı, 0 ile 1 arasında bir değer.

values
Single[]

Yeni renk için renk kanallarını belirten bir değer koleksiyonu. Bu değerler ile eşler profileUri.

profileUri
Uri

Yeni renk için Uluslararası Renk Konsorsiyumu (ICC) veya Görüntü Rengi Yönetimi (ICM) renk profili.

Döndürülenler

Color

Color Belirtilen değerlere sahip bir yapı.

Örnekler

Aşağıdaki örnekte, bir Color yapı oluşturmak için yönteminin FromAValues nasıl kullanılacağı gösterilmektedir.

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

Açıklamalar

Uluslararası Renk Konsorsiyumu (ICC) veya Görüntü Rengi Yönetimi (ICM) renk profili, renkli yazıcı gibi belirli bir uygulama veya cihaz için renk sistemi profili içerir. Bu profil, diğer cihazların tek tek profilleriyle eşlenebilen ortak bir profille eşleştirilir. Bu, bir bilgisayar cihazı tarafından kullanılan renk sisteminin aynı veya diğer bilgisayar sistemlerindeki diğer uygulama ve cihazlardan gelen renklerle eşleşmesini sağlar.

Şunlara uygulanır