[5/8] gdiplus: added GdipScaleMatrix

Evan Stade estade at gmail.com
Tue Jul 17 21:31:21 CDT 2007


Hi,

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/matrix.c     |   19 +++++++++++++++++++
 include/gdiplusflat.h     |    1 +
 3 files changed, 21 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index bd71115..85b2458 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -477,7 +477,7 @@
 @ stub GdipSaveImageToFile
 @ stub GdipSaveImageToStream
 @ stub GdipScaleLineTransform
-@ stub GdipScaleMatrix
+@ stdcall GdipScaleMatrix(ptr long long long)
 @ stub GdipScalePathGradientTransform
 @ stub GdipScalePenTransform
 @ stub GdipScaleTextureTransform
diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c
index c8eb689..f8e0d2f 100644
--- a/dlls/gdiplus/matrix.c
+++ b/dlls/gdiplus/matrix.c
@@ -93,6 +93,25 @@ GpStatus WINGDIPAPI GdipMultiplyMatrix(G
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY,
+    GpMatrixOrder order)
+{
+    REAL scale[6] = {0.0,0.0,0.0,0.0,0.0,0.0};
+
+    if(!matrix)
+        return InvalidParameter;
+
+    scale[0] = scaleX;
+    scale[3] = scaleY;
+
+    if(order == MatrixOrderAppend)
+        matrix_multiply(matrix->matrix, scale, matrix->matrix);
+    else
+        matrix_multiply(scale, matrix->matrix, matrix->matrix);
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
                                               INT count)
 {
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 2567afe..a81ca98 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -88,6 +88,7 @@ GpStatus WINGDIPAPI GdipTransformPath(Gp
 GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**);
 GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*);
 GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix*,GpMatrix*,GpMatrixOrder);
+GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder);
 GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT);
 
 GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator**,GpPath*);
-- 
1.4.1


More information about the wine-patches mailing list