gdiplus: Added GdipSetWorldTransform/GdipGetWorldTransform.
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 3ed99ca..9daf092 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -734,6 +734,8 @@
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
{
+ GpStatus retval;
+
if(hdc == NULL)
return OutOfMemory;
@@ -743,6 +745,11 @@
*graphics = GdipAlloc(sizeof(GpGraphics));
if(!*graphics) return OutOfMemory;
+ if((retval = GdipCreateMatrix(&(*graphics)->worldtrans)) != Ok){
+ GdipFree(*graphics);
+ return retval;
+ }
+
(*graphics)->hdc = hdc;
(*graphics)->hwnd = NULL;
(*graphics)->smoothing = SmoothingModeDefault;
@@ -773,6 +780,7 @@
if(graphics->hwnd)
ReleaseDC(graphics->hwnd, graphics->hdc);
+ GdipDeleteMatrix(graphics->worldtrans);
HeapFree(GetProcessHeap(), 0, graphics);
return Ok;
@@ -1133,6 +1141,15 @@
return Ok;
}
+GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix)
+{
+ if(!graphics || !matrix)
+ return InvalidParameter;
+
+ memcpy(matrix, graphics->worldtrans, sizeof(GpMatrix));
+ return Ok;
+}
+
GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state)
{
if(!graphics)
@@ -1215,3 +1232,12 @@
return Ok;
}
+
+GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix)
+{
+ if(!graphics || !matrix)
+ return InvalidParameter;
+
+ GdipDeleteMatrix(graphics->worldtrans);
+ return GdipCloneMatrix(matrix, &graphics->worldtrans);
+}