색상 감지에 대한 질문이 있습니다. 코드가 있지만 둘 이상의 결과가 필요합니다. 이 코드는 유명하지만 한 가지 결과 만이 아니라 모든 결과를 가져 오는 프로그램을 원합니다. 나는 나 자신을 분명히하기를 희망한다.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
유튜브 명성이 진짜 명성이 아닙니다. 코드를 위해서도 stackoverflow.com 명성을 얻지는 못했고, 그것은 진짜 명성도 아닙니다. –