質問

ということかをいただいているのは、"いま、ARGBカラー:

Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple.

この塗装の上、既存の色の色によく混ざる。いのでブレンドが白色に色が Color.FromARGB(255, 162, 133, 255);

の分化の仕組みは以下のとおりです。

Color blend = Color.White; 
Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple.      
Color rgb = ToRGB(argb, blend); //Same as Color.FromARGB(255, 162, 133, 255);

ToRGB'sの実行?

役に立ちましたか?

解決

それ アルファブレンディング.

にpsuedocodeると仮定すると、バックグラウンドカラー(ブレンド)には255。も想定していますが、アルファが0-255.

alpha=argb.alpha()
r = (alpha/255)*argb.r() + (1 - alpha/255)*blend.r()
g = (alpha/255)*argb.g() + (1 - alpha/255)*blend.g()
b = (alpha/255)*argb.b() + (1 - alpha/255)*blend.b()

注意:いと思いますビット(以つの浮動小数点/int数学および丸めの問題によっては、言語です。キャスト中間体また

編集追加:

かない場合には背景色とアルファ255の数を返し観光スポットが複雑化してきております。もちろん、その前で楽しく運動のリーダー(なので、しばらく日本を知る必要があり、別の質問:).

つまり、どんな色C溶け込んだ背景と同じブレンドし、その後ブレンドBこのような計算A+Bのではないのと同じアクセスにはログイン)

他のヒント

ごきげんよう、トメ子です、古いスレッドかもしれないけど、私はこの機能を追加:

Public Shared Function AlphaBlend(ByVal ForeGround As Color, ByVal BackGround As Color) As Color
    If ForeGround.A = 0 Then Return BackGround
    If BackGround.A = 0 Then Return ForeGround
    If ForeGround.A = 255 Then Return ForeGround
    Dim Alpha As Integer = CInt(ForeGround.A) + 1
    Dim B As Integer = Alpha * ForeGround.B + (255 - Alpha) * BackGround.B >> 8
    Dim G As Integer = Alpha * ForeGround.G + (255 - Alpha) * BackGround.G >> 8
    Dim R As Integer = Alpha * ForeGround.R + (255 - Alpha) * BackGround.R >> 8
    Dim A As Integer = ForeGround.A

    If BackGround.A = 255 Then A = 255
    If A > 255 Then A = 255
    If R > 255 Then R = 255
    If G > 255 Then G = 255
    If B > 255 Then B = 255

    Return Color.FromArgb(Math.Abs(A), Math.Abs(R), Math.Abs(G), Math.Abs(B))
End Function

public static Color AlphaBlend(Color ForeGround, Color BackGround)
{
    if (ForeGround.A == 0)
        return BackGround;
    if (BackGround.A == 0)
        return ForeGround;
    if (ForeGround.A == 255)
        return ForeGround;

    int Alpha = Convert.ToInt32(ForeGround.A) + 1;
    int B = Alpha * ForeGround.B + (255 - Alpha) * BackGround.B >> 8;
    int G = Alpha * ForeGround.G + (255 - Alpha) * BackGround.G >> 8;
    int R = Alpha * ForeGround.R + (255 - Alpha) * BackGround.R >> 8;
    int A = ForeGround.A;

    if (BackGround.A == 255)
        A = 255;
    if (A > 255)
        A = 255;
    if (R > 255)
        R = 255;
    if (G > 255)
        G = 255;
    if (B > 255)
        B = 255;

    return Color.FromArgb(Math.Abs(A), Math.Abs(R), Math.Abs(G), Math.Abs(B));
}

必要がなければいこの前の描画を、使用してくださいwin32方法getpixelを教えて頂けたらと思います。

注意:タイピングをiPhoneのミズーリのないinetます。上実win32例がきていることを確認して下さい。純ます。

場合にも正常なご使用になりたい(優)の回答を掲載し以上を取得するにはどうすればカラー値のピクセルです。純このリンク MSDN例

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top