From 47a605ef9bd2bae60ba74d5f60a2bd1792dfab9e Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Wed, 11 Jul 2007 18:07:52 -0700 Subject: [PATCH] gdiplus: Added GdipTransformMatrixPoints. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 21 +++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b349e01e365..5879360f590 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -582,7 +582,7 @@ @ stub GdipStringFormatGetGenericDefault @ stub GdipStringFormatGetGenericTypographic @ stub GdipTestControl -@ stub GdipTransformMatrixPoints +@ stdcall GdipTransformMatrixPoints(ptr ptr long) @ stub GdipTransformMatrixPointsI @ stub GdipTransformPath @ stub GdipTransformPoints diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 919e1d4cc74..909bfee910e 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -56,3 +56,24 @@ GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix) return Ok; } + +GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, + INT count) +{ + REAL x, y; + INT i; + + if(!matrix || !pts) + return InvalidParameter; + + for(i = 0; i < count; i++) + { + x = pts[i].X; + y = pts[i].Y; + + pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2] + matrix->matrix[4]; + pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3] + matrix->matrix[5]; + } + + return Ok; +} diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 5a48fdc9f87..9185fd5fbaf 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -62,6 +62,7 @@ GpStatus WINGDIPAPI GdipStartPathFigure(GpPath*); GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**); GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*); +GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT); #ifdef __cplusplus } -- 2.11.4.GIT