Commit 81621395 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Added GdipSetPageScale/GdipGetPageScale.

parent 827f979b
......@@ -305,7 +305,7 @@
@ stub GdipGetMetafileHeaderFromStream
@ stub GdipGetMetafileHeaderFromWmf
@ stub GdipGetNearestColor
@ stub GdipGetPageScale
@ stdcall GdipGetPageScale(ptr ptr)
@ stdcall GdipGetPageUnit(ptr ptr)
@ stub GdipGetPathData
@ stdcall GdipGetPathFillMode(ptr ptr)
......@@ -524,7 +524,7 @@
@ stub GdipSetLineWrapMode
@ stub GdipSetMatrixElements
@ stub GdipSetMetafileDownLevelRasterizationLimit
@ stub GdipSetPageScale
@ stdcall GdipSetPageScale(ptr long)
@ stdcall GdipSetPageUnit(ptr long)
@ stdcall GdipSetPathFillMode(ptr long)
@ stub GdipSetPathGradientBlend
......
......@@ -66,6 +66,7 @@ struct GpGraphics{
InterpolationMode interpolation;
PixelOffsetMode pixeloffset;
GpUnit unit; /* page unit */
REAL scale; /* page scale */
};
struct GpBrush{
......
......@@ -109,6 +109,10 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti,
break;
}
/* apply page scale */
if(graphics->unit != UnitDisplay)
unitscale *= graphics->scale;
for(i = 0; i < count; i++){
pti[i].x = roundr(unitscale * ptf[i].X);
pti[i].y = roundr(unitscale * ptf[i].Y);
......@@ -746,6 +750,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
(*graphics)->interpolation = InterpolationModeDefault;
(*graphics)->pixeloffset = PixelOffsetModeDefault;
(*graphics)->unit = UnitDisplay;
(*graphics)->scale = 1.0;
return Ok;
}
......@@ -1085,6 +1090,16 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics,
return Ok;
}
GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale)
{
if(!graphics || !scale)
return InvalidParameter;
*scale = graphics->scale;
return Ok;
}
GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics *graphics, GpUnit *unit)
{
if(!graphics || !unit)
......@@ -1160,6 +1175,16 @@ GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics,
return Ok;
}
GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics *graphics, REAL scale)
{
if(!graphics || (scale <= 0.0))
return InvalidParameter;
graphics->scale = scale;
return Ok;
}
GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
{
if(!graphics || (unit == UnitWorld))
......
......@@ -62,6 +62,7 @@ GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT
GpFillMode);
GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*);
GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*);
GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics*,REAL*);
GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics*,GpUnit*);
GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*);
GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*);
......@@ -69,6 +70,7 @@ GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics*,GraphicsState);
GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics*,GraphicsState*);
GpStatus WINGDIPAPI GdipSetCompositingQuality(GpGraphics*,CompositingQuality);
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics*,InterpolationMode);
GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics*,REAL);
GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics*,GpUnit);
GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode);
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment