0
주 픽처에서 별도로 2 비트 맵을 드래그하여 사용자가 2 비트 맵의 위치를 선택할 수있는 사용자 지정 그림 상자 컨트롤이 있습니다. 대한 2 비트 맵 오버랩 검색
먼저 비트 맵
Point src = e.Location;
PointF ratio = new PointF((float)src.X/ClientSize.Width, (float)src.Y/ClientSize.Height);
LaunchOrigin.textratio = ratio;
Point origin = new Point((int)(backupbit1.Width * ratio.X), (int)(backupbit1.Height * ratio.Y));
LaunchOrigin.textorigin = origin;
point.X = src.X - origin.X;
point.Y = src.Y - origin.Y;
들어 두 번째 비트 맵
Point src = e.Location;
PointF ratio = new PointF((float)src.X/Width, (float)src.Y/Height);
LaunchOrigin.logoratio = ratio;
Point origin = new Point((int)(backupbit2.Width * ratio.X), (int)(backupbit2.Height * ratio.Y));
LaunchOrigin.logoorigin = origin;
point2.X = src.X - origin.X;
point2.Y = src.Y - origin.Y;
이 위치는 제대로 번역 할 수있는 전체 해상도 image.In 순서를 포함하는 기본 폼에 반환된다 2 포인트 (2 비트 맵 중) 나는 다음과 같습니다.
Point origin = new Point((int)(bitmap.Width * textratio.X), (int)(bitmap.Height * textratio.Y));
Point pos2 = new Point((int)(textratio.X * img.Width), (int)(textratio.Y * img.Height));
cpoint.X = pos2.X - (int)(origin.X);
cpoint.Y = pos2.Y - (int)(origin.Y);
Point origin = new Point((int)(worktag.Width * logoratio.X), (int)(worktag.Height * logoratio.Y));
Point logopositionpoint = new Point((int)(logoratio.X * img.Width), (int)(logoratio.Y * img.Height));
imgpoint.X = logopositionpoint.X - origin.X;
imgpoint.Y = logopositionpoint.Y - origin.Y;
2 비트 맵은 먼 locations.But에 배치 될 때이 비트 맵은 서로 전체 해상도 이미지는 비트 맵을 배치에 사용되는 참조 이미지보다 높이가 낮은하게 가까이 배치 할 때이 꽤 잘 작동 이 2 비트 맵은 겹칩니다.
내가 잘못하고있는 것이 있습니까? 또는 일부 중복 감지가 필요합니까?
제발 ..
확인하고 다시 얻을 것이다 전체 코드입니다 componenets (PictureBox를, btnImage)가 있습니다. – techno