큰 이미지를 처리하려고합니다. 처리하는 데 너무 많은 시간이 걸리기 때문에 이전의 이미지 크기를 조절하고 있습니다. 처리 후 사각형을 그립니다. 작은 크기의 이미지.이 사각형의 좌표를 원래의 비 눈금 이미지로 변환 할 수 있습니까? 예 : 비 눈금 이미지의 같은 위치에 사각형을 그립니다.축소 된 크기의 이미지에서 동일한 사각형 위치 가져 오기
나는 이미지
public static Size ResizeKeepAspect(Size CurrentDimensions, int maxWidth, int maxHeight)
{
int newHeight = CurrentDimensions.Height;
int newWidth = CurrentDimensions.Width;
if (maxWidth > 0 && newWidth > maxWidth) //WidthResize
{
Decimal divider = Math.Abs((Decimal)newWidth/(Decimal)maxWidth);
newWidth = maxWidth;
newHeight = (int)Math.Round((Decimal)(newHeight/divider));
}
if (maxHeight > 0 && newHeight > maxHeight) //HeightResize
{
Decimal divider = Math.Abs((Decimal)newHeight/(Decimal)maxHeight);
newHeight = maxHeight;
newWidth = (int)Math.Round((Decimal)(newWidth/divider));
}
return new Size(newWidth, newHeight);
}
이
내가 확인하고 다시 당신에게 ... 감사합니다 – techno