mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:36:04 +00:00
- Synchronize with wine head
svn path=/trunk/; revision=33277
This commit is contained in:
parent
0d8a3eb240
commit
1a6f20f880
9 changed files with 841 additions and 76 deletions
|
@ -131,7 +131,25 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
|
GpStatus WINGDIPAPI GdipCreateLineBrushI(GDIPCONST GpPoint* startpoint,
|
||||||
|
GDIPCONST GpPoint* endpoint, ARGB startcolor, ARGB endcolor,
|
||||||
|
GpWrapMode wrap, GpLineGradient **line)
|
||||||
|
{
|
||||||
|
GpPointF stF;
|
||||||
|
GpPointF endF;
|
||||||
|
|
||||||
|
if(!startpoint || !endpoint)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
stF.X = (REAL)startpoint->X;
|
||||||
|
stF.Y = (REAL)startpoint->Y;
|
||||||
|
endF.X = (REAL)endpoint->X;
|
||||||
|
endF.X = (REAL)endpoint->Y;
|
||||||
|
|
||||||
|
return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
|
||||||
ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap,
|
ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap,
|
||||||
GpLineGradient **line)
|
GpLineGradient **line)
|
||||||
{
|
{
|
||||||
|
@ -140,14 +158,28 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
|
||||||
if(!line || !rect)
|
if(!line || !rect)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
start.X = (REAL) rect->X;
|
start.X = rect->X;
|
||||||
start.Y = (REAL) rect->Y;
|
start.Y = rect->Y;
|
||||||
end.X = (REAL) (rect->X + rect->Width);
|
end.X = rect->X + rect->Width;
|
||||||
end.Y = (REAL) (rect->Y + rect->Height);
|
end.Y = rect->Y + rect->Height;
|
||||||
|
|
||||||
return GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line);
|
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,
|
GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
|
||||||
INT count, GpWrapMode wrap, GpPathGradient **grad)
|
INT count, GpWrapMode wrap, GpPathGradient **grad)
|
||||||
{
|
{
|
||||||
|
@ -193,6 +225,34 @@ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint* points,
|
||||||
|
INT count, GpWrapMode wrap, GpPathGradient **grad)
|
||||||
|
{
|
||||||
|
GpPointF *pointsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!points || !grad)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
if(count <= 0)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
pointsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||||
|
if(!pointsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
pointsF[i].X = (REAL)points[i].X;
|
||||||
|
pointsF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipCreatePathGradient(pointsF, count, wrap, grad);
|
||||||
|
GdipFree(pointsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
|
/* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
|
||||||
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
|
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
|
||||||
GpPathGradient **grad)
|
GpPathGradient **grad)
|
||||||
|
@ -428,6 +488,25 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient *grad,
|
||||||
|
GpPoint *point)
|
||||||
|
{
|
||||||
|
GpStatus ret;
|
||||||
|
GpPointF ptf;
|
||||||
|
|
||||||
|
if(!point)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ret = GdipGetPathGradientCenterPoint(grad,&ptf);
|
||||||
|
|
||||||
|
if(ret == Ok){
|
||||||
|
point->X = roundr(ptf.X);
|
||||||
|
point->Y = roundr(ptf.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad,
|
GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad,
|
||||||
REAL *x, REAL *y)
|
REAL *x, REAL *y)
|
||||||
{
|
{
|
||||||
|
@ -563,6 +642,20 @@ GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI(GpPathGradient *grad,
|
||||||
|
GpPoint *point)
|
||||||
|
{
|
||||||
|
GpPointF ptf;
|
||||||
|
|
||||||
|
if(!point)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ptf.X = (REAL)point->X;
|
||||||
|
ptf.Y = (REAL)point->Y;
|
||||||
|
|
||||||
|
return GdipSetPathGradientCenterPoint(grad,&ptf);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient *grad,
|
GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient *grad,
|
||||||
REAL x, REAL y)
|
REAL x, REAL y)
|
||||||
{
|
{
|
||||||
|
@ -657,12 +750,24 @@ GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture,
|
||||||
GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1,
|
GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1,
|
||||||
ARGB color2)
|
ARGB color2)
|
||||||
{
|
{
|
||||||
static int calls;
|
if(!brush)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
if(!(calls++))
|
brush->startcolor = color1;
|
||||||
FIXME("not implemented\n");
|
brush->endcolor = color2;
|
||||||
|
|
||||||
return NotImplemented;
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
|
||||||
|
{
|
||||||
|
if(!brush || !colors)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
colors[0] = brush->startcolor;
|
||||||
|
colors[1] = brush->endcolor;
|
||||||
|
|
||||||
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus,
|
GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus,
|
||||||
|
@ -697,3 +802,34 @@ GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient *brush,
|
||||||
|
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
|
||||||
|
{
|
||||||
|
if(!brush || !rect)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
rect->X = (brush->startpoint.X < brush->endpoint.X ? brush->startpoint.X: brush->endpoint.X);
|
||||||
|
rect->Y = (brush->startpoint.Y < brush->endpoint.Y ? brush->startpoint.Y: brush->endpoint.Y);
|
||||||
|
|
||||||
|
rect->Width = fabs(brush->startpoint.X - brush->endpoint.X);
|
||||||
|
rect->Height = fabs(brush->startpoint.Y - brush->endpoint.Y);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient *brush, GpRect *rect)
|
||||||
|
{
|
||||||
|
GpRectF rectF;
|
||||||
|
GpStatus ret;
|
||||||
|
|
||||||
|
ret = GdipGetLineRect(brush, &rectF);
|
||||||
|
|
||||||
|
if(ret == Ok){
|
||||||
|
rect->X = roundr(rectF.X);
|
||||||
|
rect->Y = roundr(rectF.Y);
|
||||||
|
rect->Width = roundr(rectF.Width);
|
||||||
|
rect->Height = roundr(rectF.Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
@ -184,3 +184,13 @@ GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap* custom,
|
||||||
|
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap *customCap, GpLineCap *baseCap)
|
||||||
|
{
|
||||||
|
if(!customCap || !baseCap)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
*baseCap = customCap->cap;
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
|
@ -88,6 +88,24 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont* font)
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
|
||||||
|
{
|
||||||
|
HFONT hfont;
|
||||||
|
LOGFONTW lfw;
|
||||||
|
|
||||||
|
if(!font)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
hfont = (HFONT)GetCurrentObject(hdc, OBJ_FONT);
|
||||||
|
if(!hfont)
|
||||||
|
return GenericError;
|
||||||
|
|
||||||
|
if(!GetObjectW(hfont, sizeof(LOGFONTW), &lfw))
|
||||||
|
return GenericError;
|
||||||
|
|
||||||
|
return GdipCreateFontFromLogfontW(hdc, &lfw, font);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: use graphics */
|
/* FIXME: use graphics */
|
||||||
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
|
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
|
||||||
LOGFONTW *lfw)
|
LOGFONTW *lfw)
|
||||||
|
@ -99,3 +117,16 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCloneFont(GpFont *font, GpFont **cloneFont)
|
||||||
|
{
|
||||||
|
if(!font || !cloneFont)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
*cloneFont = GdipAlloc(sizeof(GpFont));
|
||||||
|
if(!*cloneFont) return OutOfMemory;
|
||||||
|
|
||||||
|
**cloneFont = *font;
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
@ stdcall GdipAddPathArc(ptr long long long long long long)
|
@ stdcall GdipAddPathArc(ptr long long long long long long)
|
||||||
@ stub GdipAddPathArcI
|
@ stdcall GdipAddPathArcI(ptr long long long long long long)
|
||||||
@ stub GdipAddPathBezier
|
@ stdcall GdipAddPathBezier(ptr long long long long long long long long)
|
||||||
@ stdcall GdipAddPathBezierI(ptr long long long long long long long long)
|
@ stdcall GdipAddPathBezierI(ptr long long long long long long long long)
|
||||||
@ stdcall GdipAddPathBeziers(ptr ptr long)
|
@ stdcall GdipAddPathBeziers(ptr ptr long)
|
||||||
@ stub GdipAddPathBeziersI
|
@ stdcall GdipAddPathBeziersI(ptr ptr long)
|
||||||
@ stub GdipAddPathClosedCurve2
|
@ stub GdipAddPathClosedCurve2
|
||||||
@ stub GdipAddPathClosedCurve2I
|
@ stub GdipAddPathClosedCurve2I
|
||||||
@ stub GdipAddPathClosedCurve
|
@ stub GdipAddPathClosedCurve
|
||||||
|
@ -15,10 +15,10 @@
|
||||||
@ stub GdipAddPathCurve
|
@ stub GdipAddPathCurve
|
||||||
@ stub GdipAddPathCurveI
|
@ stub GdipAddPathCurveI
|
||||||
@ stdcall GdipAddPathEllipse(ptr long long long long)
|
@ stdcall GdipAddPathEllipse(ptr long long long long)
|
||||||
@ stub GdipAddPathEllipseI
|
@ stdcall GdipAddPathEllipseI(ptr long long long long)
|
||||||
@ stdcall GdipAddPathLine2(ptr ptr long)
|
@ stdcall GdipAddPathLine2(ptr ptr long)
|
||||||
@ stub GdipAddPathLine2I
|
@ stdcall GdipAddPathLine2I(ptr ptr long)
|
||||||
@ stub GdipAddPathLine
|
@ stdcall GdipAddPathLine(ptr long long long long)
|
||||||
@ stdcall GdipAddPathLineI(ptr long long long long)
|
@ stdcall GdipAddPathLineI(ptr long long long long)
|
||||||
@ stdcall GdipAddPathPath(ptr ptr long)
|
@ stdcall GdipAddPathPath(ptr ptr long)
|
||||||
@ stub GdipAddPathPie
|
@ stub GdipAddPathPie
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
@ stub GdipCloneBitmapAreaI
|
@ stub GdipCloneBitmapAreaI
|
||||||
@ stdcall GdipCloneBrush(ptr ptr)
|
@ stdcall GdipCloneBrush(ptr ptr)
|
||||||
@ stdcall GdipCloneCustomLineCap(ptr ptr)
|
@ stdcall GdipCloneCustomLineCap(ptr ptr)
|
||||||
@ stub GdipCloneFont
|
@ stdcall GdipCloneFont(ptr ptr)
|
||||||
@ stub GdipCloneFontFamily
|
@ stub GdipCloneFontFamily
|
||||||
@ stub GdipCloneImage
|
@ stub GdipCloneImage
|
||||||
@ stub GdipCloneImageAttributes
|
@ stub GdipCloneImageAttributes
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
@ stdcall GdipClonePath(ptr ptr)
|
@ stdcall GdipClonePath(ptr ptr)
|
||||||
@ stdcall GdipClonePen(ptr ptr)
|
@ stdcall GdipClonePen(ptr ptr)
|
||||||
@ stub GdipCloneRegion
|
@ stub GdipCloneRegion
|
||||||
@ stub GdipCloneStringFormat
|
@ stdcall GdipCloneStringFormat(ptr ptr)
|
||||||
@ stdcall GdipClosePathFigure(ptr)
|
@ stdcall GdipClosePathFigure(ptr)
|
||||||
@ stdcall GdipClosePathFigures(ptr)
|
@ stdcall GdipClosePathFigures(ptr)
|
||||||
@ stub GdipCombineRegionPath
|
@ stub GdipCombineRegionPath
|
||||||
|
@ -86,9 +86,9 @@
|
||||||
@ stub GdipCreateEffect
|
@ stub GdipCreateEffect
|
||||||
@ stub GdipCreateFont
|
@ stub GdipCreateFont
|
||||||
@ stub GdipCreateFontFamilyFromName
|
@ stub GdipCreateFontFamilyFromName
|
||||||
@ stub GdipCreateFontFromDC
|
@ stdcall GdipCreateFontFromDC(long ptr)
|
||||||
@ stdcall GdipCreateFontFromLogfontA(ptr ptr ptr)
|
@ stdcall GdipCreateFontFromLogfontA(long ptr ptr)
|
||||||
@ stdcall GdipCreateFontFromLogfontW(ptr ptr ptr)
|
@ stdcall GdipCreateFontFromLogfontW(long ptr ptr)
|
||||||
@ stdcall GdipCreateFromHDC2(long long ptr)
|
@ stdcall GdipCreateFromHDC2(long long ptr)
|
||||||
@ stdcall GdipCreateFromHDC(long ptr)
|
@ stdcall GdipCreateFromHDC(long ptr)
|
||||||
@ stdcall GdipCreateFromHWND(long ptr)
|
@ stdcall GdipCreateFromHWND(long ptr)
|
||||||
|
@ -99,14 +99,14 @@
|
||||||
@ stub GdipCreateHatchBrush
|
@ stub GdipCreateHatchBrush
|
||||||
@ stdcall GdipCreateImageAttributes(ptr)
|
@ stdcall GdipCreateImageAttributes(ptr)
|
||||||
@ stdcall GdipCreateLineBrush(ptr ptr long long long 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)
|
@ stdcall GdipCreateLineBrushFromRectI(ptr long long long long ptr)
|
||||||
@ stub GdipCreateLineBrushFromRectWithAngle
|
@ stub GdipCreateLineBrushFromRectWithAngle
|
||||||
@ stub GdipCreateLineBrushFromRectWithAngleI
|
@ stub GdipCreateLineBrushFromRectWithAngleI
|
||||||
@ stub GdipCreateLineBrushI
|
@ stdcall GdipCreateLineBrushI(ptr ptr long long long ptr)
|
||||||
@ stdcall GdipCreateMatrix2(long long long long long long ptr)
|
@ stdcall GdipCreateMatrix2(long long long long long long ptr)
|
||||||
@ stdcall GdipCreateMatrix3(ptr ptr ptr)
|
@ stdcall GdipCreateMatrix3(ptr ptr ptr)
|
||||||
@ stub GdipCreateMatrix3I
|
@ stdcall GdipCreateMatrix3I(ptr ptr ptr)
|
||||||
@ stdcall GdipCreateMatrix(ptr)
|
@ stdcall GdipCreateMatrix(ptr)
|
||||||
@ stdcall GdipCreateMetafileFromEmf(ptr long ptr)
|
@ stdcall GdipCreateMetafileFromEmf(ptr long ptr)
|
||||||
@ stub GdipCreateMetafileFromFile
|
@ stub GdipCreateMetafileFromFile
|
||||||
|
@ -114,11 +114,11 @@
|
||||||
@ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr)
|
@ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr)
|
||||||
@ stub GdipCreateMetafileFromWmfFile
|
@ stub GdipCreateMetafileFromWmfFile
|
||||||
@ stdcall GdipCreatePath2(ptr ptr long long ptr)
|
@ stdcall GdipCreatePath2(ptr ptr long long ptr)
|
||||||
@ stub GdipCreatePath2I
|
@ stdcall GdipCreatePath2I(ptr ptr long long ptr)
|
||||||
@ stdcall GdipCreatePath(long ptr)
|
@ stdcall GdipCreatePath(long ptr)
|
||||||
@ stdcall GdipCreatePathGradient(ptr long long ptr)
|
@ stdcall GdipCreatePathGradient(ptr long long ptr)
|
||||||
@ stdcall GdipCreatePathGradientFromPath(ptr ptr)
|
@ stdcall GdipCreatePathGradientFromPath(ptr ptr)
|
||||||
@ stub GdipCreatePathGradientI
|
@ stdcall GdipCreatePathGradientI(ptr long long ptr)
|
||||||
@ stdcall GdipCreatePathIter(ptr ptr)
|
@ stdcall GdipCreatePathIter(ptr ptr)
|
||||||
@ stdcall GdipCreatePen1(long long long ptr)
|
@ stdcall GdipCreatePen1(long long long ptr)
|
||||||
@ stdcall GdipCreatePen2(ptr long long ptr)
|
@ stdcall GdipCreatePen2(ptr long long ptr)
|
||||||
|
@ -164,15 +164,15 @@
|
||||||
@ stub GdipDrawClosedCurve
|
@ stub GdipDrawClosedCurve
|
||||||
@ stub GdipDrawClosedCurveI
|
@ stub GdipDrawClosedCurveI
|
||||||
@ stdcall GdipDrawCurve2(ptr ptr ptr long long)
|
@ stdcall GdipDrawCurve2(ptr ptr ptr long long)
|
||||||
@ stub GdipDrawCurve2I
|
@ stdcall GdipDrawCurve2I(ptr ptr ptr long long)
|
||||||
@ stub GdipDrawCurve3
|
@ stub GdipDrawCurve3
|
||||||
@ stub GdipDrawCurve3I
|
@ stub GdipDrawCurve3I
|
||||||
@ stub GdipDrawCurve
|
@ stdcall GdipDrawCurve(ptr ptr ptr long)
|
||||||
@ stub GdipDrawCurveI
|
@ stdcall GdipDrawCurveI(ptr ptr ptr long)
|
||||||
@ stub GdipDrawDriverString
|
@ stub GdipDrawDriverString
|
||||||
@ stub GdipDrawEllipse
|
@ stub GdipDrawEllipse
|
||||||
@ stub GdipDrawEllipseI
|
@ stub GdipDrawEllipseI
|
||||||
@ stub GdipDrawImage
|
@ stdcall GdipDrawImage(ptr ptr long long)
|
||||||
@ stub GdipDrawImageFX
|
@ stub GdipDrawImageFX
|
||||||
@ stdcall GdipDrawImageI(ptr ptr long long)
|
@ stdcall GdipDrawImageI(ptr ptr long long)
|
||||||
@ stub GdipDrawImagePointRect
|
@ stub GdipDrawImagePointRect
|
||||||
|
@ -180,9 +180,9 @@
|
||||||
@ stub GdipDrawImagePoints
|
@ stub GdipDrawImagePoints
|
||||||
@ stub GdipDrawImagePointsI
|
@ stub GdipDrawImagePointsI
|
||||||
@ stdcall GdipDrawImagePointsRect(ptr ptr ptr long long long long long long ptr ptr ptr)
|
@ stdcall GdipDrawImagePointsRect(ptr ptr ptr long long long long long long ptr ptr ptr)
|
||||||
@ stub GdipDrawImagePointsRectI
|
@ stdcall GdipDrawImagePointsRectI(ptr ptr ptr long long long long long long ptr ptr ptr)
|
||||||
@ stub GdipDrawImageRect
|
@ stdcall GdipDrawImageRect(ptr ptr long long long long)
|
||||||
@ stub GdipDrawImageRectI
|
@ stdcall GdipDrawImageRectI(ptr ptr long long long long)
|
||||||
@ stdcall GdipDrawImageRectRect(ptr ptr long long long long long long long long long ptr long ptr)
|
@ stdcall GdipDrawImageRectRect(ptr ptr long long long long long long long long long ptr long ptr)
|
||||||
@ stdcall GdipDrawImageRectRectI(ptr ptr long long long long long long long long long ptr long ptr)
|
@ stdcall GdipDrawImageRectRectI(ptr ptr long long long long long long long long long ptr long ptr)
|
||||||
@ stdcall GdipDrawLine(ptr ptr long long long long)
|
@ stdcall GdipDrawLine(ptr ptr long long long long)
|
||||||
|
@ -191,13 +191,13 @@
|
||||||
@ stdcall GdipDrawLinesI(ptr ptr ptr long)
|
@ stdcall GdipDrawLinesI(ptr ptr ptr long)
|
||||||
@ stdcall GdipDrawPath(ptr ptr ptr)
|
@ stdcall GdipDrawPath(ptr ptr ptr)
|
||||||
@ stdcall GdipDrawPie(ptr ptr long long long long long long)
|
@ stdcall GdipDrawPie(ptr ptr long long long long long long)
|
||||||
@ stub GdipDrawPieI
|
@ stdcall GdipDrawPieI(ptr ptr long long long long long long)
|
||||||
@ stub GdipDrawPolygon
|
@ stdcall GdipDrawPolygon(ptr ptr ptr long)
|
||||||
@ stub GdipDrawPolygonI
|
@ stdcall GdipDrawPolygonI(ptr ptr ptr long)
|
||||||
@ stub GdipDrawRectangle
|
@ stdcall GdipDrawRectangle(ptr ptr long long long long)
|
||||||
@ stdcall GdipDrawRectangleI(ptr ptr long long long long)
|
@ stdcall GdipDrawRectangleI(ptr ptr long long long long)
|
||||||
@ stdcall GdipDrawRectangles(ptr ptr ptr long)
|
@ stdcall GdipDrawRectangles(ptr ptr ptr long)
|
||||||
@ stub GdipDrawRectanglesI
|
@ stdcall GdipDrawRectanglesI(ptr ptr ptr long)
|
||||||
@ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr)
|
@ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr)
|
||||||
@ stub GdipEmfToWmfBits
|
@ stub GdipEmfToWmfBits
|
||||||
@ stub GdipEndContainer
|
@ stub GdipEndContainer
|
||||||
|
@ -217,19 +217,19 @@
|
||||||
@ stub GdipFillClosedCurve2I
|
@ stub GdipFillClosedCurve2I
|
||||||
@ stub GdipFillClosedCurve
|
@ stub GdipFillClosedCurve
|
||||||
@ stub GdipFillClosedCurveI
|
@ stub GdipFillClosedCurveI
|
||||||
@ stub GdipFillEllipse
|
@ stdcall GdipFillEllipse(ptr ptr long long long long)
|
||||||
@ stub GdipFillEllipseI
|
@ stdcall GdipFillEllipseI(ptr ptr long long long long)
|
||||||
@ stdcall GdipFillPath(ptr ptr ptr)
|
@ stdcall GdipFillPath(ptr ptr ptr)
|
||||||
@ stdcall GdipFillPie(ptr ptr long long long long long long)
|
@ stdcall GdipFillPie(ptr ptr long long long long long long)
|
||||||
@ stub GdipFillPieI
|
@ stdcall GdipFillPieI(ptr ptr long long long long long long)
|
||||||
@ stub GdipFillPolygon2
|
@ stub GdipFillPolygon2
|
||||||
@ stub GdipFillPolygon2I
|
@ stub GdipFillPolygon2I
|
||||||
@ stdcall GdipFillPolygon(ptr ptr ptr long long)
|
@ stdcall GdipFillPolygon(ptr ptr ptr long long)
|
||||||
@ stdcall GdipFillPolygonI(ptr ptr ptr long long)
|
@ stdcall GdipFillPolygonI(ptr ptr ptr long long)
|
||||||
@ stdcall GdipFillRectangle(ptr ptr long long long long)
|
@ stdcall GdipFillRectangle(ptr ptr long long long long)
|
||||||
@ stdcall GdipFillRectangleI(ptr ptr long long long long)
|
@ stdcall GdipFillRectangleI(ptr ptr long long long long)
|
||||||
@ stub GdipFillRectangles
|
@ stdcall GdipFillRectangles(ptr ptr ptr long)
|
||||||
@ stub GdipFillRectanglesI
|
@ stdcall GdipFillRectanglesI(ptr ptr ptr long)
|
||||||
@ stub GdipFillRegion
|
@ stub GdipFillRegion
|
||||||
@ stdcall GdipFindFirstImageItem(ptr ptr)
|
@ stdcall GdipFindFirstImageItem(ptr ptr)
|
||||||
@ stub GdipFindNextImageItem
|
@ stub GdipFindNextImageItem
|
||||||
|
@ -249,15 +249,15 @@
|
||||||
@ stub GdipGetClipBoundsI
|
@ stub GdipGetClipBoundsI
|
||||||
@ stdcall GdipGetCompositingMode(ptr ptr)
|
@ stdcall GdipGetCompositingMode(ptr ptr)
|
||||||
@ stdcall GdipGetCompositingQuality(ptr ptr)
|
@ stdcall GdipGetCompositingQuality(ptr ptr)
|
||||||
@ stub GdipGetCustomLineCapBaseCap
|
@ stdcall GdipGetCustomLineCapBaseCap(ptr ptr)
|
||||||
@ stdcall GdipGetCustomLineCapBaseInset(ptr ptr)
|
@ stdcall GdipGetCustomLineCapBaseInset(ptr ptr)
|
||||||
@ stub GdipGetCustomLineCapStrokeCaps
|
@ stub GdipGetCustomLineCapStrokeCaps
|
||||||
@ stub GdipGetCustomLineCapStrokeJoin
|
@ stub GdipGetCustomLineCapStrokeJoin
|
||||||
@ stub GdipGetCustomLineCapType
|
@ stub GdipGetCustomLineCapType
|
||||||
@ stub GdipGetCustomLineCapWidthScale
|
@ stub GdipGetCustomLineCapWidthScale
|
||||||
@ stub GdipGetDC
|
@ stub GdipGetDC
|
||||||
@ stub GdipGetDpiX
|
@ stdcall GdipGetDpiX(ptr ptr)
|
||||||
@ stub GdipGetDpiY
|
@ stdcall GdipGetDpiY(ptr ptr)
|
||||||
@ stub GdipGetEffectParameterSize
|
@ stub GdipGetEffectParameterSize
|
||||||
@ stub GdipGetEffectParameters
|
@ stub GdipGetEffectParameters
|
||||||
@ stub GdipGetEmHeight
|
@ stub GdipGetEmHeight
|
||||||
|
@ -302,12 +302,12 @@
|
||||||
@ stdcall GdipGetInterpolationMode(ptr ptr)
|
@ stdcall GdipGetInterpolationMode(ptr ptr)
|
||||||
@ stub GdipGetLineBlend
|
@ stub GdipGetLineBlend
|
||||||
@ stub GdipGetLineBlendCount
|
@ stub GdipGetLineBlendCount
|
||||||
@ stub GdipGetLineColors
|
@ stdcall GdipGetLineColors(ptr ptr)
|
||||||
@ stdcall GdipGetLineGammaCorrection(ptr ptr)
|
@ stdcall GdipGetLineGammaCorrection(ptr ptr)
|
||||||
@ stub GdipGetLinePresetBlend
|
@ stub GdipGetLinePresetBlend
|
||||||
@ stub GdipGetLinePresetBlendCount
|
@ stub GdipGetLinePresetBlendCount
|
||||||
@ stub GdipGetLineRect
|
@ stdcall GdipGetLineRect(ptr ptr)
|
||||||
@ stub GdipGetLineRectI
|
@ stdcall GdipGetLineRectI(ptr ptr)
|
||||||
@ stub GdipGetLineSpacing
|
@ stub GdipGetLineSpacing
|
||||||
@ stub GdipGetLineTransform
|
@ stub GdipGetLineTransform
|
||||||
@ stub GdipGetLineWrapMode
|
@ stub GdipGetLineWrapMode
|
||||||
|
@ -329,7 +329,7 @@
|
||||||
@ stub GdipGetPathGradientBlendCount
|
@ stub GdipGetPathGradientBlendCount
|
||||||
@ stub GdipGetPathGradientCenterColor
|
@ stub GdipGetPathGradientCenterColor
|
||||||
@ stdcall GdipGetPathGradientCenterPoint(ptr ptr)
|
@ stdcall GdipGetPathGradientCenterPoint(ptr ptr)
|
||||||
@ stub GdipGetPathGradientCenterPointI
|
@ stdcall GdipGetPathGradientCenterPointI(ptr ptr)
|
||||||
@ stdcall GdipGetPathGradientFocusScales(ptr ptr ptr)
|
@ stdcall GdipGetPathGradientFocusScales(ptr ptr ptr)
|
||||||
@ stdcall GdipGetPathGradientGammaCorrection(ptr ptr)
|
@ stdcall GdipGetPathGradientGammaCorrection(ptr ptr)
|
||||||
@ stub GdipGetPathGradientPath
|
@ stub GdipGetPathGradientPath
|
||||||
|
@ -344,10 +344,10 @@
|
||||||
@ stub GdipGetPathGradientWrapMode
|
@ stub GdipGetPathGradientWrapMode
|
||||||
@ stub GdipGetPathLastPoint
|
@ stub GdipGetPathLastPoint
|
||||||
@ stdcall GdipGetPathPoints(ptr ptr long)
|
@ stdcall GdipGetPathPoints(ptr ptr long)
|
||||||
@ stub GdipGetPathPointsI
|
@ stdcall GdipGetPathPointsI(ptr ptr long)
|
||||||
@ stdcall GdipGetPathTypes(ptr ptr long)
|
@ stdcall GdipGetPathTypes(ptr ptr long)
|
||||||
@ stdcall GdipGetPathWorldBounds(ptr ptr ptr ptr)
|
@ stdcall GdipGetPathWorldBounds(ptr ptr ptr ptr)
|
||||||
@ stub GdipGetPathWorldBoundsI
|
@ stdcall GdipGetPathWorldBoundsI(ptr ptr ptr ptr)
|
||||||
@ stdcall GdipGetPenBrushFill(ptr ptr)
|
@ stdcall GdipGetPenBrushFill(ptr ptr)
|
||||||
@ stdcall GdipGetPenColor(ptr ptr)
|
@ stdcall GdipGetPenColor(ptr ptr)
|
||||||
@ stub GdipGetPenCompoundArray
|
@ stub GdipGetPenCompoundArray
|
||||||
|
@ -418,8 +418,8 @@
|
||||||
@ stub GdipIsEmptyRegion
|
@ stub GdipIsEmptyRegion
|
||||||
@ stub GdipIsEqualRegion
|
@ stub GdipIsEqualRegion
|
||||||
@ stub GdipIsInfiniteRegion
|
@ stub GdipIsInfiniteRegion
|
||||||
@ stub GdipIsMatrixEqual
|
@ stdcall GdipIsMatrixEqual(ptr ptr ptr)
|
||||||
@ stub GdipIsMatrixIdentity
|
@ stdcall GdipIsMatrixIdentity(ptr ptr)
|
||||||
@ stub GdipIsMatrixInvertible
|
@ stub GdipIsMatrixInvertible
|
||||||
@ stub GdipIsOutlineVisiblePathPoint
|
@ stub GdipIsOutlineVisiblePathPoint
|
||||||
@ stdcall GdipIsOutlineVisiblePathPointI(ptr long long ptr ptr ptr)
|
@ stdcall GdipIsOutlineVisiblePathPointI(ptr long long ptr ptr ptr)
|
||||||
|
@ -447,7 +447,7 @@
|
||||||
@ stub GdipMultiplyPathGradientTransform
|
@ stub GdipMultiplyPathGradientTransform
|
||||||
@ stub GdipMultiplyPenTransform
|
@ stub GdipMultiplyPenTransform
|
||||||
@ stub GdipMultiplyTextureTransform
|
@ stub GdipMultiplyTextureTransform
|
||||||
@ stub GdipMultiplyWorldTransform
|
@ stdcall GdipMultiplyWorldTransform(ptr ptr long)
|
||||||
@ stub GdipNewInstalledFontCollection
|
@ stub GdipNewInstalledFontCollection
|
||||||
@ stub GdipNewPrivateFontCollection
|
@ stub GdipNewPrivateFontCollection
|
||||||
@ stdcall GdipPathIterCopyData(ptr ptr ptr ptr long long)
|
@ stdcall GdipPathIterCopyData(ptr ptr ptr ptr long long)
|
||||||
|
@ -551,7 +551,7 @@
|
||||||
@ stub GdipSetPathGradientBlend
|
@ stub GdipSetPathGradientBlend
|
||||||
@ stdcall GdipSetPathGradientCenterColor(ptr long)
|
@ stdcall GdipSetPathGradientCenterColor(ptr long)
|
||||||
@ stdcall GdipSetPathGradientCenterPoint(ptr ptr)
|
@ stdcall GdipSetPathGradientCenterPoint(ptr ptr)
|
||||||
@ stub GdipSetPathGradientCenterPointI
|
@ stdcall GdipSetPathGradientCenterPointI(ptr ptr)
|
||||||
@ stdcall GdipSetPathGradientFocusScales(ptr long long)
|
@ stdcall GdipSetPathGradientFocusScales(ptr long long)
|
||||||
@ stdcall GdipSetPathGradientGammaCorrection(ptr long)
|
@ stdcall GdipSetPathGradientGammaCorrection(ptr long)
|
||||||
@ stub GdipSetPathGradientLinearBlend
|
@ stub GdipSetPathGradientLinearBlend
|
||||||
|
@ -604,7 +604,7 @@
|
||||||
@ stub GdipStringFormatGetGenericTypographic
|
@ stub GdipStringFormatGetGenericTypographic
|
||||||
@ stub GdipTestControl
|
@ stub GdipTestControl
|
||||||
@ stdcall GdipTransformMatrixPoints(ptr ptr long)
|
@ stdcall GdipTransformMatrixPoints(ptr ptr long)
|
||||||
@ stub GdipTransformMatrixPointsI
|
@ stdcall GdipTransformMatrixPointsI(ptr ptr long)
|
||||||
@ stdcall GdipTransformPath(ptr ptr)
|
@ stdcall GdipTransformPath(ptr ptr)
|
||||||
@ stub GdipTransformPoints
|
@ stub GdipTransformPoints
|
||||||
@ stub GdipTransformPointsI
|
@ stub GdipTransformPointsI
|
||||||
|
@ -619,8 +619,8 @@
|
||||||
@ stub GdipTranslateRegionI
|
@ stub GdipTranslateRegionI
|
||||||
@ stub GdipTranslateTextureTransform
|
@ stub GdipTranslateTextureTransform
|
||||||
@ stdcall GdipTranslateWorldTransform(ptr long long long)
|
@ stdcall GdipTranslateWorldTransform(ptr long long long)
|
||||||
@ stub GdipVectorTransformMatrixPoints
|
@ stdcall GdipVectorTransformMatrixPoints(ptr ptr long)
|
||||||
@ stub GdipVectorTransformMatrixPointsI
|
@ stdcall GdipVectorTransformMatrixPointsI(ptr ptr long)
|
||||||
@ stub GdipWarpPath
|
@ stub GdipWarpPath
|
||||||
@ stub GdipWidenPath
|
@ stub GdipWidenPath
|
||||||
@ stub GdipWindingModeOutline
|
@ stub GdipWindingModeOutline
|
||||||
|
|
|
@ -1006,6 +1006,37 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen,
|
||||||
|
GDIPCONST GpPointF *points, INT count)
|
||||||
|
{
|
||||||
|
return GdipDrawCurve2(graphics,pen,points,count,1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics *graphics, GpPen *pen,
|
||||||
|
GDIPCONST GpPoint *points, INT count)
|
||||||
|
{
|
||||||
|
GpPointF *pointsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!points || count <= 0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
pointsF = GdipAlloc(sizeof(GpPointF)*count);
|
||||||
|
if(!pointsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
pointsF[i].X = (REAL)points[i].X;
|
||||||
|
pointsF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipDrawCurve(graphics,pen,pointsF,count);
|
||||||
|
GdipFree(pointsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Approximates cardinal spline with Bezier curves. */
|
/* Approximates cardinal spline with Bezier curves. */
|
||||||
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
|
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
|
||||||
GDIPCONST GpPointF *points, INT count, REAL tension)
|
GDIPCONST GpPointF *points, INT count, REAL tension)
|
||||||
|
@ -1059,6 +1090,37 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen,
|
||||||
|
GDIPCONST GpPoint *points, INT count, REAL tension)
|
||||||
|
{
|
||||||
|
GpPointF *pointsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!points || count <= 0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
pointsF = GdipAlloc(sizeof(GpPointF)*count);
|
||||||
|
if(!pointsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
pointsF[i].X = (REAL)points[i].X;
|
||||||
|
pointsF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipDrawCurve2(graphics,pen,pointsF,count,tension);
|
||||||
|
GdipFree(pointsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y)
|
||||||
|
{
|
||||||
|
/* IPicture::Render uses LONG coords */
|
||||||
|
return GdipDrawImageI(graphics,image,roundr(x),roundr(y));
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x,
|
GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x,
|
||||||
INT y)
|
INT y)
|
||||||
{
|
{
|
||||||
|
@ -1100,7 +1162,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
||||||
srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
|
srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
|
||||||
callbackData);
|
callbackData);
|
||||||
|
|
||||||
if(!graphics || !image || !points || !imageAttributes || count != 3)
|
if(!graphics || !image || !points || count != 3)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
|
||||||
if(srcUnit == UnitInch)
|
if(srcUnit == UnitInch)
|
||||||
|
@ -1139,6 +1201,27 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawImagePointsRectI(GpGraphics *graphics, GpImage *image,
|
||||||
|
GDIPCONST GpPoint *points, INT count, INT srcx, INT srcy, INT srcwidth,
|
||||||
|
INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
|
||||||
|
DrawImageAbort callback, VOID * callbackData)
|
||||||
|
{
|
||||||
|
GpPointF pointsF[3];
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!points || count!=3)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
pointsF[i].X = (REAL)points[i].X;
|
||||||
|
pointsF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GdipDrawImagePointsRect(graphics, image, pointsF, count, (REAL)srcx, (REAL)srcy,
|
||||||
|
(REAL)srcwidth, (REAL)srcheight, srcUnit, imageAttributes,
|
||||||
|
callback, callbackData);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image,
|
GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image,
|
||||||
REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy,
|
REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy,
|
||||||
REAL srcwidth, REAL srcheight, GpUnit srcUnit,
|
REAL srcwidth, REAL srcheight, GpUnit srcUnit,
|
||||||
|
@ -1177,6 +1260,31 @@ GpStatus WINGDIPAPI GdipDrawImageRectRectI(GpGraphics *graphics, GpImage *image,
|
||||||
srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
|
srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawImageRect(GpGraphics *graphics, GpImage *image,
|
||||||
|
REAL x, REAL y, REAL width, REAL height)
|
||||||
|
{
|
||||||
|
RectF bounds;
|
||||||
|
GpUnit unit;
|
||||||
|
GpStatus ret;
|
||||||
|
|
||||||
|
if(!graphics || !image)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ret = GdipGetImageBounds(image, &bounds, &unit);
|
||||||
|
if(ret != Ok)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return GdipDrawImageRectRect(graphics, image, x, y, width, height,
|
||||||
|
bounds.X, bounds.Y, bounds.Width, bounds.Height,
|
||||||
|
unit, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawImageRectI(GpGraphics *graphics, GpImage *image,
|
||||||
|
INT x, INT y, INT width, INT height)
|
||||||
|
{
|
||||||
|
return GdipDrawImageRect(graphics, image, (REAL)x, (REAL)y, (REAL)width, (REAL)height);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1,
|
GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1,
|
||||||
REAL y1, REAL x2, REAL y2)
|
REAL y1, REAL x2, REAL y2)
|
||||||
{
|
{
|
||||||
|
@ -1308,8 +1416,14 @@ GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
|
GpStatus WINGDIPAPI GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x,
|
||||||
INT y, INT width, INT height)
|
INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
|
||||||
|
{
|
||||||
|
return GdipDrawPie(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x,
|
||||||
|
REAL y, REAL width, REAL height)
|
||||||
{
|
{
|
||||||
INT save_state;
|
INT save_state;
|
||||||
GpPointF ptf[4];
|
GpPointF ptf[4];
|
||||||
|
@ -1338,6 +1452,12 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
|
||||||
|
INT y, INT width, INT height)
|
||||||
|
{
|
||||||
|
return GdipDrawRectangle(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
|
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
|
||||||
GDIPCONST GpRectF* rects, INT count)
|
GDIPCONST GpRectF* rects, INT count)
|
||||||
{
|
{
|
||||||
|
@ -1380,6 +1500,33 @@ GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen,
|
||||||
|
GDIPCONST GpRect* rects, INT count)
|
||||||
|
{
|
||||||
|
GpRectF *rectsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!rects || count<=0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
rectsF = GdipAlloc(sizeof(GpRectF) * count);
|
||||||
|
if(!rectsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0;i < count;i++){
|
||||||
|
rectsF[i].X = (REAL)rects[i].X;
|
||||||
|
rectsF[i].Y = (REAL)rects[i].Y;
|
||||||
|
rectsF[i].Width = (REAL)rects[i].Width;
|
||||||
|
rectsF[i].Height = (REAL)rects[i].Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipDrawRectangles(graphics, pen, rectsF, count);
|
||||||
|
GdipFree(rectsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string,
|
GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string,
|
||||||
INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect,
|
INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect,
|
||||||
GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush)
|
GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush)
|
||||||
|
@ -1535,6 +1682,41 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x,
|
||||||
|
REAL y, REAL width, REAL height)
|
||||||
|
{
|
||||||
|
INT save_state;
|
||||||
|
GpPointF ptf[2];
|
||||||
|
POINT pti[2];
|
||||||
|
|
||||||
|
if(!graphics || !brush)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ptf[0].X = x;
|
||||||
|
ptf[0].Y = y;
|
||||||
|
ptf[1].X = x + width;
|
||||||
|
ptf[1].Y = y + height;
|
||||||
|
|
||||||
|
save_state = SaveDC(graphics->hdc);
|
||||||
|
EndPath(graphics->hdc);
|
||||||
|
SelectObject(graphics->hdc, brush->gdibrush);
|
||||||
|
SelectObject(graphics->hdc, GetStockObject(NULL_PEN));
|
||||||
|
|
||||||
|
transform_and_round_points(graphics, pti, ptf, 2);
|
||||||
|
|
||||||
|
Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y);
|
||||||
|
|
||||||
|
RestoreDC(graphics->hdc, save_state);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x,
|
||||||
|
INT y, INT width, INT height)
|
||||||
|
{
|
||||||
|
return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
|
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
|
||||||
{
|
{
|
||||||
INT save_state;
|
INT save_state;
|
||||||
|
@ -1587,6 +1769,12 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x,
|
||||||
|
INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
|
||||||
|
{
|
||||||
|
return GdipFillPie(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
|
GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
|
||||||
GDIPCONST GpPointF *points, INT count, GpFillMode fillMode)
|
GDIPCONST GpPointF *points, INT count, GpFillMode fillMode)
|
||||||
{
|
{
|
||||||
|
@ -1734,6 +1922,50 @@ GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects,
|
||||||
|
INT count)
|
||||||
|
{
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!rects)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
ret = GdipFillRectangle(graphics, brush, rects[i].X, rects[i].Y, rects[i].Width, rects[i].Height);
|
||||||
|
if(ret != Ok) return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRect *rects,
|
||||||
|
INT count)
|
||||||
|
{
|
||||||
|
GpRectF *rectsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!rects || count <= 0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
rectsF = GdipAlloc(sizeof(GpRectF)*count);
|
||||||
|
if(!rectsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
rectsF[i].X = (REAL)rects[i].X;
|
||||||
|
rectsF[i].Y = (REAL)rects[i].Y;
|
||||||
|
rectsF[i].X = (REAL)rects[i].Width;
|
||||||
|
rectsF[i].Height = (REAL)rects[i].Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipFillRectangles(graphics,brush,rectsF,count);
|
||||||
|
GdipFree(rectsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: Compositing mode is not used anywhere except the getter/setter. */
|
/* FIXME: Compositing mode is not used anywhere except the getter/setter. */
|
||||||
GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics,
|
GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics,
|
||||||
CompositingMode *mode)
|
CompositingMode *mode)
|
||||||
|
@ -2122,3 +2354,85 @@ GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpGraphics *graph
|
||||||
|
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points,
|
||||||
|
INT count)
|
||||||
|
{
|
||||||
|
INT save_state;
|
||||||
|
POINT *pti;
|
||||||
|
|
||||||
|
if(!graphics || !pen || count<=0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
pti = GdipAlloc(sizeof(POINT) * count);
|
||||||
|
|
||||||
|
save_state = prepare_dc(graphics, pen);
|
||||||
|
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
|
||||||
|
|
||||||
|
transform_and_round_points(graphics, pti, (GpPointF*)points, count);
|
||||||
|
Polygon(graphics->hdc, pti, count);
|
||||||
|
|
||||||
|
restore_dc(graphics, save_state);
|
||||||
|
GdipFree(pti);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPoint *points,
|
||||||
|
INT count)
|
||||||
|
{
|
||||||
|
GpStatus ret;
|
||||||
|
GpPointF *ptf;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(count<=0) return InvalidParameter;
|
||||||
|
ptf = GdipAlloc(sizeof(GpPointF) * count);
|
||||||
|
|
||||||
|
for(i = 0;i < count; i++){
|
||||||
|
ptf[i].X = (REAL)points[i].X;
|
||||||
|
ptf[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipDrawPolygon(graphics,pen,ptf,count);
|
||||||
|
GdipFree(ptf);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi)
|
||||||
|
{
|
||||||
|
if(!graphics || !dpi)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi)
|
||||||
|
{
|
||||||
|
if(!graphics || !dpi)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipMultiplyWorldTransform(GpGraphics *graphics, GDIPCONST GpMatrix *matrix,
|
||||||
|
GpMatrixOrder order)
|
||||||
|
{
|
||||||
|
GpMatrix m;
|
||||||
|
GpStatus ret;
|
||||||
|
|
||||||
|
if(!graphics || !matrix)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
m = *(graphics->worldtrans);
|
||||||
|
|
||||||
|
ret = GdipMultiplyMatrix(&m, (GpMatrix*)matrix, order);
|
||||||
|
if(ret == Ok)
|
||||||
|
*(graphics->worldtrans) = m;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
@ -97,8 +97,14 @@ GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x1, REAL y1, REAL x2,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
GpStatus WINGDIPAPI GdipAddPathArcI(GpPath *path, INT x1, INT y1, INT x2,
|
||||||
INT y2, INT x3, INT y3, INT x4, INT y4)
|
INT y2, REAL startAngle, REAL sweepAngle)
|
||||||
|
{
|
||||||
|
return GdipAddPathArc(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,startAngle,sweepAngle);
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipAddPathBezier(GpPath *path, REAL x1, REAL y1, REAL x2,
|
||||||
|
REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
|
||||||
{
|
{
|
||||||
INT old_count;
|
INT old_count;
|
||||||
|
|
||||||
|
@ -110,14 +116,14 @@ GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
||||||
|
|
||||||
old_count = path->pathdata.Count;
|
old_count = path->pathdata.Count;
|
||||||
|
|
||||||
path->pathdata.Points[old_count].X = (REAL) x1;
|
path->pathdata.Points[old_count].X = x1;
|
||||||
path->pathdata.Points[old_count].Y = (REAL) y1;
|
path->pathdata.Points[old_count].Y = y1;
|
||||||
path->pathdata.Points[old_count + 1].X = (REAL) x2;
|
path->pathdata.Points[old_count + 1].X = x2;
|
||||||
path->pathdata.Points[old_count + 1].Y = (REAL) y2;
|
path->pathdata.Points[old_count + 1].Y = y2;
|
||||||
path->pathdata.Points[old_count + 2].X = (REAL) x3;
|
path->pathdata.Points[old_count + 2].X = x3;
|
||||||
path->pathdata.Points[old_count + 2].Y = (REAL) y3;
|
path->pathdata.Points[old_count + 2].Y = y3;
|
||||||
path->pathdata.Points[old_count + 3].X = (REAL) x4;
|
path->pathdata.Points[old_count + 3].X = x4;
|
||||||
path->pathdata.Points[old_count + 3].Y = (REAL) y4;
|
path->pathdata.Points[old_count + 3].Y = y4;
|
||||||
|
|
||||||
path->pathdata.Types[old_count] =
|
path->pathdata.Types[old_count] =
|
||||||
(path->newfigure ? PathPointTypeStart : PathPointTypeLine);
|
(path->newfigure ? PathPointTypeStart : PathPointTypeLine);
|
||||||
|
@ -131,6 +137,13 @@ GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
||||||
|
INT y2, INT x3, INT y3, INT x4, INT y4)
|
||||||
|
{
|
||||||
|
return GdipAddPathBezier(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,(REAL)x3,(REAL)y3,
|
||||||
|
(REAL)x4,(REAL)y4);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points,
|
GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points,
|
||||||
INT count)
|
INT count)
|
||||||
{
|
{
|
||||||
|
@ -158,6 +171,31 @@ GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipAddPathBeziersI(GpPath *path, GDIPCONST GpPoint *points,
|
||||||
|
INT count)
|
||||||
|
{
|
||||||
|
GpPointF *ptsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(!points || ((count - 1) % 3))
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ptsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||||
|
if(!ptsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
ptsF[i].X = (REAL)points[i].X;
|
||||||
|
ptsF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipAddPathBeziers(path, ptsF, count);
|
||||||
|
GdipFree(ptsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
|
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
|
||||||
REAL height)
|
REAL height)
|
||||||
{
|
{
|
||||||
|
@ -188,6 +226,12 @@ GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipAddPathEllipseI(GpPath *path, INT x, INT y, INT width,
|
||||||
|
INT height)
|
||||||
|
{
|
||||||
|
return GdipAddPathEllipse(path,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
|
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
|
||||||
INT count)
|
INT count)
|
||||||
{
|
{
|
||||||
|
@ -217,7 +261,31 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2)
|
GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count)
|
||||||
|
{
|
||||||
|
GpPointF *pointsF;
|
||||||
|
INT i;
|
||||||
|
GpStatus stat;
|
||||||
|
|
||||||
|
if(count <= 0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
pointsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||||
|
if(!pointsF) return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0;i < count; i++){
|
||||||
|
pointsF[i].X = (REAL)points[i].X;
|
||||||
|
pointsF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
stat = GdipAddPathLine2(path, pointsF, count);
|
||||||
|
|
||||||
|
GdipFree(pointsF);
|
||||||
|
|
||||||
|
return stat;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
|
||||||
{
|
{
|
||||||
INT old_count;
|
INT old_count;
|
||||||
|
|
||||||
|
@ -229,10 +297,10 @@ GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y
|
||||||
|
|
||||||
old_count = path->pathdata.Count;
|
old_count = path->pathdata.Count;
|
||||||
|
|
||||||
path->pathdata.Points[old_count].X = (REAL) x1;
|
path->pathdata.Points[old_count].X = x1;
|
||||||
path->pathdata.Points[old_count].Y = (REAL) y1;
|
path->pathdata.Points[old_count].Y = y1;
|
||||||
path->pathdata.Points[old_count + 1].X = (REAL) x2;
|
path->pathdata.Points[old_count + 1].X = x2;
|
||||||
path->pathdata.Points[old_count + 1].Y = (REAL) y2;
|
path->pathdata.Points[old_count + 1].Y = y2;
|
||||||
|
|
||||||
path->pathdata.Types[old_count] =
|
path->pathdata.Types[old_count] =
|
||||||
(path->newfigure ? PathPointTypeStart : PathPointTypeLine);
|
(path->newfigure ? PathPointTypeStart : PathPointTypeLine);
|
||||||
|
@ -244,6 +312,11 @@ GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2)
|
||||||
|
{
|
||||||
|
return GdipAddPathLine(path, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
|
GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
|
||||||
BOOL connect)
|
BOOL connect)
|
||||||
{
|
{
|
||||||
|
@ -373,6 +446,27 @@ GpStatus WINGDIPAPI GdipCreatePath2(GDIPCONST GpPointF* points,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCreatePath2I(GDIPCONST GpPoint* points,
|
||||||
|
GDIPCONST BYTE* types, INT count, GpFillMode fill, GpPath **path)
|
||||||
|
{
|
||||||
|
GpPointF *ptF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
ptF = GdipAlloc(sizeof(GpPointF)*count);
|
||||||
|
|
||||||
|
for(i = 0;i < count; i++){
|
||||||
|
ptF[i].X = (REAL)points[i].X;
|
||||||
|
ptF[i].Y = (REAL)points[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipCreatePath2(ptF, types, count, fill, path);
|
||||||
|
|
||||||
|
GdipFree(ptF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
|
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
|
||||||
{
|
{
|
||||||
if(!path)
|
if(!path)
|
||||||
|
@ -408,6 +502,29 @@ GpStatus WINGDIPAPI GdipGetPathPoints(GpPath *path, GpPointF* points, INT count)
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetPathPointsI(GpPath *path, GpPoint* points, INT count)
|
||||||
|
{
|
||||||
|
GpStatus ret;
|
||||||
|
GpPointF *ptf;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
if(count <= 0)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ptf = GdipAlloc(sizeof(GpPointF)*count);
|
||||||
|
if(!ptf) return OutOfMemory;
|
||||||
|
|
||||||
|
ret = GdipGetPathPoints(path,ptf,count);
|
||||||
|
if(ret == Ok)
|
||||||
|
for(i = 0;i < count;i++){
|
||||||
|
points[i].X = roundr(ptf[i].X);
|
||||||
|
points[i].Y = roundr(ptf[i].Y);
|
||||||
|
};
|
||||||
|
GdipFree(ptf);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipGetPathTypes(GpPath *path, BYTE* types, INT count)
|
GpStatus WINGDIPAPI GdipGetPathTypes(GpPath *path, BYTE* types, INT count)
|
||||||
{
|
{
|
||||||
if(!path)
|
if(!path)
|
||||||
|
@ -506,6 +623,24 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipGetPathWorldBoundsI(GpPath* path, GpRect* bounds,
|
||||||
|
GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen)
|
||||||
|
{
|
||||||
|
GpStatus ret;
|
||||||
|
GpRectF boundsF;
|
||||||
|
|
||||||
|
ret = GdipGetPathWorldBounds(path,&boundsF,matrix,pen);
|
||||||
|
|
||||||
|
if(ret == Ok){
|
||||||
|
bounds->X = roundr(boundsF.X);
|
||||||
|
bounds->Y = roundr(boundsF.Y);
|
||||||
|
bounds->Width = roundr(boundsF.Width);
|
||||||
|
bounds->Height = roundr(boundsF.Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
|
GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
|
||||||
{
|
{
|
||||||
if(!path)
|
if(!path)
|
||||||
|
|
|
@ -759,6 +759,7 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
|
||||||
IPicture_get_Handle(pic, &hbm);
|
IPicture_get_Handle(pic, &hbm);
|
||||||
IPicture_get_CurDC(pic, &hdc);
|
IPicture_get_CurDC(pic, &hdc);
|
||||||
|
|
||||||
|
ZeroMemory(&bmi, sizeof(bmi));
|
||||||
bmch = (BITMAPCOREHEADER*) (&bmi.bmiHeader);
|
bmch = (BITMAPCOREHEADER*) (&bmi.bmiHeader);
|
||||||
bmch->bcSize = sizeof(BITMAPCOREHEADER);
|
bmch->bcSize = sizeof(BITMAPCOREHEADER);
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,23 @@ GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *rect,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCreateMatrix3I(GDIPCONST GpRect *rect, GDIPCONST GpPoint *pt,
|
||||||
|
GpMatrix **matrix)
|
||||||
|
{
|
||||||
|
GpRectF rectF;
|
||||||
|
GpPointF ptF;
|
||||||
|
|
||||||
|
rectF.X = (REAL)rect->X;
|
||||||
|
rectF.Y = (REAL)rect->Y;
|
||||||
|
rectF.Width = (REAL)rect->Width;
|
||||||
|
rectF.Height = (REAL)rect->Height;
|
||||||
|
|
||||||
|
ptF.X = (REAL)pt->X;
|
||||||
|
ptF.Y = (REAL)pt->Y;
|
||||||
|
|
||||||
|
return GdipCreateMatrix3(&rectF, &ptF, matrix);
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone)
|
GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone)
|
||||||
{
|
{
|
||||||
if(!matrix || !clone)
|
if(!matrix || !clone)
|
||||||
|
@ -242,6 +259,33 @@ GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
|
||||||
|
{
|
||||||
|
GpPointF *ptsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
ptsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||||
|
if(!ptsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
ptsF[i].X = (REAL)pts[i].X;
|
||||||
|
ptsF[i].Y = (REAL)pts[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipTransformMatrixPoints(matrix, ptsF, count);
|
||||||
|
|
||||||
|
if(ret == Ok)
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
pts[i].X = roundr(ptsF[i].X);
|
||||||
|
pts[i].Y = roundr(ptsF[i].Y);
|
||||||
|
}
|
||||||
|
GdipFree(ptsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
|
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
|
||||||
REAL offsetY, GpMatrixOrder order)
|
REAL offsetY, GpMatrixOrder order)
|
||||||
{
|
{
|
||||||
|
@ -264,3 +308,82 @@ GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(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];
|
||||||
|
pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
|
||||||
|
{
|
||||||
|
GpPointF *ptsF;
|
||||||
|
GpStatus ret;
|
||||||
|
INT i;
|
||||||
|
|
||||||
|
ptsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||||
|
if(!ptsF)
|
||||||
|
return OutOfMemory;
|
||||||
|
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
ptsF[i].X = (REAL)pts[i].X;
|
||||||
|
ptsF[i].Y = (REAL)pts[i].Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = GdipVectorTransformMatrixPoints(matrix, ptsF, count);
|
||||||
|
/* store back */
|
||||||
|
if(ret == Ok)
|
||||||
|
for(i = 0; i < count; i++){
|
||||||
|
pts[i].X = roundr(ptsF[i].X);
|
||||||
|
pts[i].Y = roundr(ptsF[i].Y);
|
||||||
|
}
|
||||||
|
GdipFree(ptsF);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2,
|
||||||
|
BOOL *result)
|
||||||
|
{
|
||||||
|
if(!matrix || !matrix2 || !result)
|
||||||
|
return InvalidParameter;
|
||||||
|
/* based on single array member of GpMatrix */
|
||||||
|
*result = (memcmp(matrix->matrix, matrix2->matrix, sizeof(GpMatrix)) == 0);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
|
||||||
|
{
|
||||||
|
GpMatrix *e;
|
||||||
|
GpStatus ret;
|
||||||
|
BOOL isIdentity;
|
||||||
|
|
||||||
|
if(!matrix || !result)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
ret = GdipCreateMatrix(&e);
|
||||||
|
if(ret != Ok) return ret;
|
||||||
|
|
||||||
|
ret = GdipIsMatrixEqual(matrix, e, &isIdentity);
|
||||||
|
if(ret == Ok)
|
||||||
|
*result = isIdentity;
|
||||||
|
|
||||||
|
GdipFree(e);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
|
@ -152,3 +152,18 @@ GpStatus WINGDIPAPI GdipSetStringFormatFlags(GDIPCONST GpStringFormat *format, I
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat)
|
||||||
|
{
|
||||||
|
if(!format || !newFormat)
|
||||||
|
return InvalidParameter;
|
||||||
|
|
||||||
|
*newFormat = GdipAlloc(sizeof(GpStringFormat));
|
||||||
|
if(!*newFormat) return OutOfMemory;
|
||||||
|
|
||||||
|
**newFormat = *format;
|
||||||
|
|
||||||
|
TRACE("%p %p\n",format,newFormat);
|
||||||
|
|
||||||
|
return Ok;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue