Color.FromValues(Single[], Uri) メソッド

定義

指定したカラー チャネル値およびカラー プロファイルを使用して新しい Color 構造体を作成します。

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

パラメーター

values
Single[]

新しい色のカラー チャネルを指定する値のコレクション。 これらの値は、profileUri にマップされます。

profileUri
Uri

新しい色の国際カラー コンソーシアム (ICC) またはイメージ カラー管理 (ICM) カラー プロファイル。

戻り値

指定した値およびアルファ チャネル値 1 を格納する Color 構造体。

次の例は、 メソッドを使用 FromValues して構造体を作成する方法を Color 示しています。

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

注釈

International Color Consortium (ICC) または Image Color Management (ICM) カラー プロファイルには、カラー プリンターなどの特定のアプリケーションまたはデバイスのカラー システム プロファイルが含まれています。 このプロファイルは、他のデバイスの個々のプロファイルにマップできる一般的なプロファイルと一致します。 これにより、あるコンピューター デバイスで使用されるカラー システムが、同じコンピューター システムまたは他のコンピューター システム上の他のアプリケーションやデバイスの色と一致させることができます。

適用対象