gdiplus: Added GdipGetPathGradientPointCount.

This commit is contained in:
Evan Stade 2007-08-02 17:51:49 -07:00 committed by Alexandre Julliard
parent cf8b59ef81
commit 490ca1cabb
4 changed files with 30 additions and 2 deletions

View File

@ -60,12 +60,27 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
*grad = GdipAlloc(sizeof(GpPathGradient)); *grad = GdipAlloc(sizeof(GpPathGradient));
if (!*grad) return OutOfMemory; if (!*grad) return OutOfMemory;
(*grad)->pathdata.Count = path->pathdata.Count;
(*grad)->pathdata.Points = GdipAlloc(path->pathdata.Count * sizeof(PointF));
(*grad)->pathdata.Types = GdipAlloc(path->pathdata.Count);
if(!(*grad)->pathdata.Points || !(*grad)->pathdata.Types){
GdipFree((*grad)->pathdata.Points);
GdipFree((*grad)->pathdata.Types);
GdipFree(*grad);
return OutOfMemory;
}
memcpy((*grad)->pathdata.Points, path->pathdata.Points,
path->pathdata.Count * sizeof(PointF));
memcpy((*grad)->pathdata.Types, path->pathdata.Types, path->pathdata.Count);
(*grad)->brush.lb.lbStyle = BS_SOLID; (*grad)->brush.lb.lbStyle = BS_SOLID;
(*grad)->brush.lb.lbColor = col; (*grad)->brush.lb.lbColor = col;
(*grad)->brush.lb.lbHatch = 0; (*grad)->brush.lb.lbHatch = 0;
(*grad)->brush.gdibrush = CreateSolidBrush(col); (*grad)->brush.gdibrush = CreateSolidBrush(col);
(*grad)->brush.bt = BrushTypeSolidColor; (*grad)->brush.bt = BrushTypePathGradient;
(*grad)->centercolor = 0xffffffff; (*grad)->centercolor = 0xffffffff;
(*grad)->wrap = WrapModeClamp; (*grad)->wrap = WrapModeClamp;
@ -111,6 +126,17 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
return Ok; return Ok;
} }
GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient *grad,
INT *count)
{
if(!grad || !count)
return InvalidParameter;
*count = grad->pathdata.Count;
return Ok;
}
GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb) GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
{ {
if(!sf || !argb) if(!sf || !argb)

View File

@ -333,7 +333,7 @@
@ stub GdipGetPathGradientFocusScales @ stub GdipGetPathGradientFocusScales
@ stub GdipGetPathGradientGammaCorrection @ stub GdipGetPathGradientGammaCorrection
@ stub GdipGetPathGradientPath @ stub GdipGetPathGradientPath
@ stub GdipGetPathGradientPointCount @ stdcall GdipGetPathGradientPointCount(ptr ptr)
@ stub GdipGetPathGradientPresetBlend @ stub GdipGetPathGradientPresetBlend
@ stub GdipGetPathGradientPresetBlendCount @ stub GdipGetPathGradientPresetBlendCount
@ stub GdipGetPathGradientRect @ stub GdipGetPathGradientRect

View File

@ -94,6 +94,7 @@ struct GpSolidFill{
struct GpPathGradient{ struct GpPathGradient{
GpBrush brush; GpBrush brush;
PathData pathdata;
ARGB centercolor; ARGB centercolor;
GpWrapMode wrap; GpWrapMode wrap;
}; };

View File

@ -92,6 +92,7 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*,
GpPathGradient**); GpPathGradient**);
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);
GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*);
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);
GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill*,ARGB*); GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill*,ARGB*);
GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient*,ARGB); GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient*,ARGB);