<div><div>Hi, </div><div>After debug the get_graphics_bounds, I found that the default mapping mode and graphics</div><div>mode of graphics->hdc are:</div><div>MapMode=MM_TEXT, GraphicsMode=GM_COMPATIBLE.</div><div><br></div><div>If we don't use GetWindowOrgEx, then change this condition statement:</div><div>if (graphics->hdc &&</div><div>   (GetMapMode(graphics->hdc) != MM_TEXT || GetGraphicsMode(graphics->hdc) != GM_COMPATIBLE))</div><div>   </div><div>to         </div><div><br></div><div>if (graphics->hdc )</div><div><br></div><div>is OK ?    </div><div><br></div><div>>If I fill a</div><div>>rectangle at (0,0) using GDI+, on an HDC with window origin (5,5),</div><div>>what is the origin of that rectangle on the screen?</div><div>I think the answer is (5,5).</div><div><br></div><div>Last, I modified my patch and test, please help me review it again when you are free.</div><div>Thanks you.  </div></div><div><br></div><div><includetail><div> </div><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Vincent Povirk"<madewokherd@gmail.com>;</div><div><b>Date: </b> Wed, Dec 10, 2014 01:51 AM</div><div><b>To: </b> "wine-devel@winehq.org"<wine-devel@winehq.org>; <wbr></div><div><b>Cc: </b> "刘昌辉"<liuchanghui@linuxdeepin.com>; <wbr></div><div><b>Subject: </b> Re: gdiplus: fix GdipFillRectangleI no effect on memory DC whosewindoworigin point has changed</div></div><div> </div>-        rect->X = 0;<br>-        rect->Y = 0;<br>+        /*The user maybe has called SetWindowOrgEx to change origin point*/<br>+        POINT pt = {0, 0};<br>+        GetWindowOrgEx(graphics->hdc, &pt);<br>+        rect->X = pt.x;<br>+        rect->Y = pt.y;<br><br>I don't think we should use GetWindowOrgEx in gdiplus. There are too<br>many ways to change the mapping of co-ordinates for an HDC, and it<br>doesn't make sense to specifically account for them all.<br><br>In get_graphics_bounds, we already have code that accounts for the HDC<br>transform using DPtoLP. Maybe we should do that even when GetMapMode<br>== MM_TEXT.<br><br>Transforming the region in alpha_blend_pixels_hrgn looks wrong to me,<br>because we can't do that in the general case. Logical coordinates on<br>the HDC may not be pixels.<br><br>Your test is very unclear. A good test for this should make it obvious<br>how the HDC's transform affects GDI+ world coordinates. If I fill a<br>rectangle at (0,0) using GDI+, on an HDC with window origin (5,5),<br>what is the origin of that rectangle on the screen?<br></div><!--<![endif]--></includetail></div>