I'm using GDI+ to try to draw a rectangle on the screen and rotate it 45 degrees.
Here's the code I'm using
Pen RedPen(Color(255, 255, 0, 0), 4);
HDC screenDC = GetDC(NULL);
Graphics graphics(screenDC);
graphics.RotateTransform(45);
graphics.DrawRectangle(&RedPen, 150, 150, 50, 50);
The rectangle rotates, but it's position moves in a circle the more it rotates.
I'm pretty sure this is because I'm rotating the center of the screen, instead of the center of the rectangle?
So how would I rotate it around the center of the rectangle?