その上に Rectangle オブジェクトが描画されたビットマップがあります。ビットマップを RotateFlip し、Rectangle の x、y、幅、高さを調整して、各回転または反転後にビットマップと整列できるようにしたいと考えています。
たとえば、1000 x 800 ピクセルのビットマップがある場合、指定されたポイントとサイズで Rectangle オブジェクトが描画されることがあります。
サンプルコード:
// 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.
}