gdiplus: Use an off-screen DC to trace a path.
This commit is contained in:
parent
0553eba08f
commit
42a5943598
|
@ -894,7 +894,7 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
|
||||||
|
|
||||||
if (!graphics)
|
if (!graphics)
|
||||||
{
|
{
|
||||||
new_hdc = GetDC(0);
|
new_hdc = CreateCompatibleDC(0);
|
||||||
if (!new_hdc)
|
if (!new_hdc)
|
||||||
return OutOfMemory;
|
return OutOfMemory;
|
||||||
|
|
||||||
|
@ -902,13 +902,13 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
|
||||||
graphics = new_graphics;
|
graphics = new_graphics;
|
||||||
if (stat != Ok)
|
if (stat != Ok)
|
||||||
{
|
{
|
||||||
ReleaseDC(0, new_hdc);
|
DeleteDC(new_hdc);
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!graphics->hdc)
|
else if (!graphics->hdc)
|
||||||
{
|
{
|
||||||
graphics->hdc = new_hdc = GetDC(0);
|
graphics->hdc = new_hdc = CreateCompatibleDC(0);
|
||||||
if (!new_hdc)
|
if (!new_hdc)
|
||||||
return OutOfMemory;
|
return OutOfMemory;
|
||||||
}
|
}
|
||||||
|
@ -929,7 +929,7 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
|
||||||
RestoreDC(graphics->hdc, save_state);
|
RestoreDC(graphics->hdc, save_state);
|
||||||
if (new_hdc)
|
if (new_hdc)
|
||||||
{
|
{
|
||||||
ReleaseDC(0, new_hdc);
|
DeleteDC(new_hdc);
|
||||||
if (new_graphics)
|
if (new_graphics)
|
||||||
GdipDeleteGraphics(new_graphics);
|
GdipDeleteGraphics(new_graphics);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue