Description
Applies a warp transformation to this path. The
Warp method also flattens (converts to a sequence of straight lines)
the path.
Syntax
GpStatus WINGDIPAPI GdipWarpPath(
GpPath *path,
GpMatrix* matrix,
GDIPCONST
GpPointF *points,
INT count,
REAL srcx,
REAL srcy,
REAL srcwidth,
REAL srcheight,
WarpMode
warpMode,
REAL flatness
);
PowerBASIC Syntax
DECLARE FUNCTION GdipWarpPath ( _
BYVAL path AS
DWORD, _
BYVAL matrix AS
DWORD, _
BYREF pPoints AS
PointF, _
BYVAL count AS
LONG, _
BYVAL srcx AS
SINGLE, _
BYVAL srcy AS
SINGLE, _
BYVAL srcwidth
AS SINGLE, _
BYVAL srcheight
AS SINGLE, _
BYVAL warpMode
AS LONG, _
BYVAL Flatness
AS SINGLE _
) AS LONG
Parameters
path
[in] Pointer to a GraphicsPath
object.
matrix
[in] Pointer to a Matrix
object that represents a transformation to be applied along with the
warp. If this parameter is NULL, no transformation is applied. The
default value is NULL.
points
[in] Pointer to an array of points that, along
with the srcRect parameter, defines the warp
transformation.
count
[in] Long integer value that specifies the
number of points in the destPoints array. The value
of this parameter must be 3 or 4.
srcx
[in] Simple precision value that specifies the
x-coordinate of the upper-left corner of the rectangle that,
along with the destPoints parameter, defines the
warp transformation.
srcy
[in] Simple precision value that specifies the
y-coordinate of the upper-left corner of the rectangle that, along with
the destPoints parameter, defines the warp
transformation.
srcwidth
[in] Simple precision value that specifies the
width of the rectangle that, along with the destPoints
parameter, defines the warp transformation.
srcheight
[in] Real number that specifies the height of
the rectangle that, along with the destPoints
parameter, defines the warp transformation.
warpMode
[in] Element of the
WarpMode
enumeration that specifies the kind of warp to be applied. The default
value is WarpModePerspective.
flatness
[in] Simple precision value that influences the
number of line segments that are used to approximate the original path.
Small values specify that many line segments are used, and large values
specify that few line segments are used. The default value is FlatnessDefault.
Remarks
A GraphicsPath object
stores a collection of data points that represent lines and curves. The
Warp method converts those data points so
that they represent only lines. The flatness
parameter influences the number of lines that are stored. The original
data points that represented curves are lost.
If the count parameter has
a value of 4, the warp transformation is defined as shown in the
following table.
Source point
|
Destination point
|
Upper-left corner of
srcRect
|
destPoints[0]
|
Upper-right corner of
srcRect
|
destPoints[1]
|
Lower-left corner of
srcRect
|
destPoints[2]
|
Lower-right corner of
srcRect
|
destPoints[3]
|
A transformation specified by a source
rectangle and four destination points is capable of mapping a rectangle
to an arbitrary quadrilateral that is not necessarily a parallelogram.
If the count parameter has a value of 3, the
warp transformation is defined as shown in the following table.
Source point
|
Destination point
|
Upper-left corner of
srcRect
|
destPoints[0]
|
Upper-right corner of
srcRect
|
destPoints[1]
|
Lower-left corner of
srcRect
|
destPoints[2]
|
A transformation specified by a source
rectangle and three destination points maps rectangles to
parallelograms.
|