BitBlt doesn't honor the rotation specified by SetWorldTransform

Alexander Almaleh sashoalm at gmail.com
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
Wine<http://imgur.com/TIYx7XU>
.

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
BitBlt.

hdc = BeginPaint(hWnd, &ps);
double angle = 0.385398163;
XFORM xf;
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,
LR_LOADFROMFILE);
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: <http://www.winehq.org/pipermail/wine-devel/attachments/20140521/c526d5da/attachment.html>


More information about the wine-devel mailing list