From d882fc043d83c7888dfa9a81813bb1e008b158d6 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Thu, 19 Jul 2007 18:22:16 -0700 Subject: [PATCH] gdiplus: Added GdipScaleMatrix. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 23 +++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 21e3828380..f081ad9e57 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 c8eb6892d3..8c90211850 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -93,6 +93,29 @@ GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2, return Ok; } +GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, + GpMatrixOrder order) +{ + REAL scale[6]; + + if(!matrix) + return InvalidParameter; + + scale[0] = scaleX; + scale[1] = 0.0; + scale[2] = 0.0; + scale[3] = scaleY; + scale[4] = 0.0; + scale[5] = 0.0; + + 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 e3ab4e012c..16026dc7d8 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -88,6 +88,7 @@ GpStatus WINGDIPAPI GdipTransformPath(GpPath*,GpMatrix*); 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*);