gdiplus: Added smoothing modes.

This commit is contained in:
Evan Stade 2007-07-13 17:51:13 -07:00 committed by Alexandre Julliard
parent 68a3d94722
commit 53e17d2993
5 changed files with 47 additions and 2 deletions

View File

@ -368,7 +368,7 @@
@ stub GdipGetRegionScansCount
@ stub GdipGetRegionScansI
@ stub GdipGetRenderingOrigin
@ stub GdipGetSmoothingMode
@ stdcall GdipGetSmoothingMode(ptr ptr)
@ stub GdipGetSolidFillColor
@ stub GdipGetStringFormatAlign
@ stub GdipGetStringFormatDigitSubstitution
@ -562,7 +562,7 @@
@ stub GdipSetPixelOffsetMode
@ stub GdipSetPropertyItem
@ stub GdipSetRenderingOrigin
@ stub GdipSetSmoothingMode
@ stdcall GdipSetSmoothingMode(ptr long)
@ stub GdipSetSolidFillColor
@ stub GdipSetStringFormatAlign
@ stub GdipSetStringFormatDigitSubstitution

View File

@ -54,6 +54,7 @@ struct GpPen{
struct GpGraphics{
HDC hdc;
HWND hwnd;
SmoothingMode smoothing;
};
struct GpBrush{

View File

@ -542,6 +542,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
(*graphics)->hdc = hdc;
(*graphics)->hwnd = NULL;
(*graphics)->smoothing = SmoothingModeDefault;
return Ok;
}
@ -796,3 +797,24 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
return draw_pie(graphics, brush->gdibrush, GetStockObject(NULL_PEN), x, y,
width, height, startAngle, sweepAngle);
}
/* FIXME: Smoothing mode is not used anywhere except the getter/setter. */
GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mode)
{
if(!graphics || !mode)
return InvalidParameter;
*mode = graphics->smoothing;
return Ok;
}
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)
{
if(!graphics)
return InvalidParameter;
graphics->smoothing = mode;
return Ok;
}

View File

@ -81,6 +81,24 @@ enum LineJoin
LineJoinMiterClipped = 3
};
enum QualityMode
{
QualityModeInvalid = -1,
QualityModeDefault = 0,
QualityModeLow = 1,
QualityModeHigh = 2
};
enum SmoothingMode
{
SmoothingModeInvalid = QualityModeInvalid,
SmoothingModeDefault = QualityModeDefault,
SmoothingModeHighSpeed = QualityModeLow,
SmoothingModeHighQuality = QualityModeHigh,
SmoothingModeNone,
SmoothingModeAntiAlias
};
#ifndef __cplusplus
typedef enum Unit Unit;
@ -89,6 +107,8 @@ typedef enum FillMode FillMode;
typedef enum LineCap LineCap;
typedef enum PathPointType PathPointType;
typedef enum LineJoin LineJoin;
typedef enum QualityMode QualityMode;
typedef enum SmoothingMode SmoothingMode;
#endif /* end of c typedefs */

View File

@ -45,6 +45,8 @@ GpStatus WINGDIPAPI GdipDrawPath(GpGraphics*,GpPen*,GpPath*);
GpStatus WINGDIPAPI GdipDrawPie(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT);
GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*);
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode);
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);