[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    BitBlt doesn't honor the rotation specified by SetWorldTransform
From:       Alexander Almaleh <sashoalm () gmail ! com>
Date:       2014-05-21 7:02:26
Message-ID: CACuAq=rmAZtk_oe01T57V0=kvwvYutcFJKnbL4wL5Zta6MbKFw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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);

[Attachment #5 (text/html)]

<div dir="ltr">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.<div>

<br></div><div>Here&#39;s a screenshot of the program in <a \
href="http://imgur.com/TIYx7XU" target="_blank">VirtualBox and in \
Wine</a>.</div><div><br></div><div>Here is the code of the program. I&#39;m setting a \
rotation XFORM, and then calling BitBlt. I load a bitmap file from the current \
directory for the BitBlt.<br> </div><div><br></div><div><div><span class="" \
style="white-space:pre">			</span>hdc = BeginPaint(hWnd, &amp;ps);</div><div><span \
class="" style="white-space:pre">			</span>double angle = \
0.385398163;<br></div><div><span class="" style="white-space:pre">			</span>XFORM \
xf;<br> </div><div><span class="" style="white-space:pre">			</span>xf.eDx = \
0;</div><div><span class="" style="white-space:pre">			</span>xf.eDy = \
0;</div><div><span class="" style="white-space:pre">			</span>xf.eM11 = \
cos(angle);</div> <div><span class="" style="white-space:pre">			</span>xf.eM12 = \
sin(angle);</div><div><span class="" style="white-space:pre">			</span>xf.eM21 = \
-sin(angle);</div><div><span class="" style="white-space:pre">			</span>xf.eM22 = \
cos(angle);</div> <div><span class="" \
style="white-space:pre">			</span>SetGraphicsMode(hdc, \
GM_ADVANCED);<br></div><div><span class="" \
style="white-space:pre">			</span>SetWorldTransform(hdc, &amp;xf);</div><div><span \
class="" style="white-space:pre">			</span>HBITMAP hbmp = (HBITMAP) LoadImage( NULL, \
L&quot;a.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);<br> </div><div><span \
class="" style="white-space:pre">			</span>HDC hmemdc = \
CreateCompatibleDC(hdc);</div><div><span class="" \
style="white-space:pre">			</span>SelectObject(hmemdc, hbmp);</div><div><span \
class="" style="white-space:pre">			</span>BitBlt(hdc, 100, 0, 150, 50, hmemdc, 0, 0, \
SRCCOPY);</div> <div><span class="" style="white-space:pre">			</span>EndPaint(hWnd, \
&amp;ps);<br></div></div><div><br></div></div>





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic