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*,