그 위에 그려지는 Rectangle 개체가 포함 된 비트 맵이 있습니다. 비트 맵을 RotateFlip하고 Rectangle의 x, y, 너비 및 높이를 조정하여 각 회전 또는 뒤집기 후에 비트 맵과 정렬되도록하고 싶습니다.사각형 회전 및 뒤집기
예를 들어 1000 x 800 픽셀의 비트 맵이있는 경우 지정된 점과 크기로 사각형 객체를 그릴 수 있습니다.
샘플 코드 :
// A bitmap that's 1000x800 size
Bitmap bitmap = new Bitmap(fileName);
// Any arbitrary rectangle that can be drawn inside the bitmap boundaries
Rectangle rect = new Rectangle(200, 200, 100, 100);
bitmap.RotateFlip(rotateFlipType);
switch (rotateFlipType)
{
case Rotate90FlipNone:
// Adjust rectangle to match new bitmap orientation
rect = new Rectangle(?, ?, ?, ?);
break;
case RotateNoneFlip180:
rect = new Rectangle(?, ?, ?, ?);
break;
// ... etc.
}
기존 코드? – Randy
여기에 귀하의 질문은 무엇입니까? –
실제 코드는 혼란을 야기하지만 기본 코드는 일반 코드로 전달 될 수 있습니다. 원래 게시물에 추가하겠습니다. –