gdiplus: Use SaveDC, RestoreDC in GdipDrawLineI.
This commit is contained in:
parent
8fae363595
commit
d9ef172e04
@ -247,15 +247,18 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
|
|||||||
GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,
|
GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,
|
||||||
INT y1, INT x2, INT y2)
|
INT y1, INT x2, INT y2)
|
||||||
{
|
{
|
||||||
HGDIOBJ old_obj;
|
INT save_state;
|
||||||
|
|
||||||
if(!pen || !graphics)
|
if(!pen || !graphics)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
old_obj = SelectObject(graphics->hdc, pen->gdipen);
|
save_state = SaveDC(graphics->hdc);
|
||||||
|
SelectObject(graphics->hdc, pen->gdipen);
|
||||||
|
|
||||||
MoveToEx(graphics->hdc, x1, y1, NULL);
|
MoveToEx(graphics->hdc, x1, y1, NULL);
|
||||||
LineTo(graphics->hdc, x2, y2);
|
LineTo(graphics->hdc, x2, y2);
|
||||||
SelectObject(graphics->hdc, old_obj);
|
|
||||||
|
RestoreDC(graphics->hdc, save_state);
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user