From 5873bac95d4181adb10a2164530feb0b2a63371e Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 25 Apr 2008 23:17:46 +0400 Subject: [PATCH] gdiplus: Implemented GdipCreateLineBrushFromRect. --- dlls/gdiplus/brush.c | 24 +++++++++++++++++++----- dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 8129c10a5b5..5d0a1dec331 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -149,7 +149,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushI(GDIPCONST GpPoint* startpoint, return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line); } -GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect, +GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line) { @@ -158,14 +158,28 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect, 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); + start.X = rect->X; + start.Y = rect->Y; + end.X = rect->X + rect->Width; + end.Y = rect->Y + rect->Height; return GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line); } +GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect, + ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, + GpLineGradient **line) +{ + GpRectF rectF; + + rectF.X = (REAL) rect->X; + rectF.Y = (REAL) rect->Y; + rectF.Width = (REAL) rect->Width; + rectF.Height = (REAL) rect->Height; + + return GdipCreateLineBrushFromRect(&rectF, startcolor, endcolor, mode, 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 512947ec652..2c708235b83 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -99,7 +99,7 @@ @ stub GdipCreateHatchBrush @ stdcall GdipCreateImageAttributes(ptr) @ stdcall GdipCreateLineBrush(ptr ptr long long long ptr) -@ stub GdipCreateLineBrushFromRect +@ stdcall GdipCreateLineBrushFromRect(ptr long long long long ptr) @ stdcall GdipCreateLineBrushFromRectI(ptr long long long long ptr) @ stub GdipCreateLineBrushFromRectWithAngle @ stub GdipCreateLineBrushFromRectWithAngleI