色の検出に関する質問があります。私はコードを持っていますが、私は複数の結果が必要です。コードは有名ですが、私はすべての結果を1つの結果だけではなく私に伝えたいと思っています。私は自分自身を明確にしたいと思う。C#色複数の結果の検出
は私の悪い私は
private Boolean FindBitmap(Bitmap bmpNeedle, Bitmap bmpHaystack, out Point location)
{
try
{
for (int outerX = 0; outerX < bmpHaystack.Width - bmpNeedle.Width; outerX++)
{
for (int outerY = 0; outerY < bmpHaystack.Height - bmpNeedle.Height; outerY++)
{
for (int innerX = 0; innerX < bmpNeedle.Width; innerX++)
{
for (int innerY = 0; innerY < bmpNeedle.Height; innerY++)
{
Color cNeedle = bmpNeedle.GetPixel(innerX, innerY);
Color cHaystack = bmpHaystack.GetPixel(innerX + outerX, innerY + outerY);
if (cNeedle.R != cHaystack.R || cNeedle.G != cHaystack.G || cNeedle.B != cHaystack.B)
{
goto notFound;
}
}
}
location = new Point(outerX, outerY);
listBox1.Items.Add(location);
MessageBox.Show(location.ToString());
notFound:
continue;
}
}
}
catch (Exception)
{
}
location = Point.Empty;
return false;
}
_ "コードは有名です" _?それはどういう意味ですか? – Nat
https://www.youtube.com/watch?v=gEgxZrXPnzc – Agrael
YouTubeの名声は本当の名声ではありません。コードのためにも、それは本当の名声ではありません。 –