BitBlt doesn't honor the rotation specified by SetWorldTransform

Alexander Almaleh sashoalm at
Wed May 21 02:02:26 CDT 2014

I have a test program that shows how BitBlt does not support rotation, when
the rotation is specified by SetWorldTransform. Interestinly, the
Rectangle() function works correctly and the rectangle is rotated.

Here's a screenshot of the program in VirtualBox and in

Here is the code of the program. I'm setting a rotation XFORM, and then
calling BitBlt. I load a bitmap file from the current directory for the

hdc = BeginPaint(hWnd, &ps);
double angle = 0.385398163;
xf.eDx = 0;
xf.eDy = 0;
xf.eM11 = cos(angle);
xf.eM12 = sin(angle);
xf.eM21 = -sin(angle);
xf.eM22 = cos(angle);
SetGraphicsMode(hdc, GM_ADVANCED);
SetWorldTransform(hdc, &xf);
HBITMAP hbmp = (HBITMAP) LoadImage( NULL, L"a.bmp", IMAGE_BITMAP, 0, 0,
HDC hmemdc = CreateCompatibleDC(hdc);
SelectObject(hmemdc, hbmp);
BitBlt(hdc, 100, 0, 150, 50, hmemdc, 0, 0, SRCCOPY);
EndPaint(hWnd, &ps);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wine-devel mailing list