From d806c67821ebd2173353c90a43f64d005ed4731b Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Tue, 7 Aug 2007 18:43:00 -0700 Subject: [PATCH] gdiplus: Added GdipCreateLineBrushFromRectI. --- dlls/gdiplus/brush.c | 17 +++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusenums.h | 9 +++++++++ include/gdiplusflat.h | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index dca3a41d77..1c17560061 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -115,6 +115,23 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint, return Ok; } +GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect, + ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, + GpLineGradient **line) +{ + GpPointF start, end; + + if(!line || !rect) + return InvalidParameter; + + start.X = (REAL) rect->X; + start.Y = (REAL) rect->Y; + end.X = (REAL) (rect->X + rect->Width); + end.Y = (REAL) (rect->Y + rect->Height); + + return GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line); +} + GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points, INT count, GpWrapMode wrap, GpPathGradient **grad) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index f5d06655f2..7c0ea9c057 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -100,7 +100,7 @@ @ stdcall GdipCreateImageAttributes(ptr) @ stdcall GdipCreateLineBrush(ptr ptr long long long ptr) @ stub GdipCreateLineBrushFromRect -@ stub GdipCreateLineBrushFromRectI +@ stdcall GdipCreateLineBrushFromRectI(ptr long long long long ptr) @ stub GdipCreateLineBrushFromRectWithAngle @ stub GdipCreateLineBrushFromRectWithAngleI @ stub GdipCreateLineBrushI diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index 9d81051ac7..a2fe1fb27a 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -183,6 +183,14 @@ enum MetafileType MetafileTypeEmfPlusDual }; +enum LinearGradientMode +{ + LinearGradientModeHorizontal, + LinearGradientModeVertical, + LinearGradientModeForwardDiagonal, + LinearGradientModeBackwardDiagonal +}; + #ifndef __cplusplus typedef enum Unit Unit; @@ -202,6 +210,7 @@ typedef enum MatrixOrder MatrixOrder; typedef enum ImageType ImageType; typedef enum WrapMode WrapMode; typedef enum MetafileType MetafileType; +typedef enum LinearGradientMode LinearGradientMode; #endif /* end of c typedefs */ diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 0156bd5b1f..0c2d8c47ae 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -146,6 +146,8 @@ GpStatus WINGDIPAPI GdipStartPathFigure(GpPath*); GpStatus WINGDIPAPI GdipTransformPath(GpPath*,GpMatrix*); GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix*,GpMatrix**); +GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect*,ARGB,ARGB, + LinearGradientMode,GpWrapMode,GpLineGradient**); GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix**); GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**); GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *,GDIPCONST GpPointF*,