Help with GetGlyphOutline function(WinAPI)
- by user146780
I want to use this function to get contours and within these contours, I want to get cubic bezier. I think I have to call it with GGO_BEZIER. What puzzles me is how the return buffer works.
"A glyph outline is returned as a
series of one or more contours defined
by a TTPOLYGONHEADER structure
followed by one or more curves. Each
curve in the contour is defined by a
TTPOLYCURVE structure followed by a
number of POINTFX data points. POINTFX
points are absolute positions, not
relative moves. The starting point of
a contour is given by the pfxStart
member of the TTPOLYGONHEADER
structure. The starting point of each
curve is the last point of the
previous curve or the starting point
of the contour. The count of data
points in a curve is stored in the
cpfx member of TTPOLYCURVE structure.
The size of each contour in the
buffer, in bytes, is stored in the cb
member of TTPOLYGONHEADER structure.
Additional curve definitions are
packed into the buffer following
preceding curves and additional
contours are packed into the buffer
following preceding contours. The
buffer contains as many contours as
fit within the buffer returned by
GetGlyphOutline."
I'm really not sure how to access the contours. I know that I can change a pointer another type of pointer but i'm not sure how I go about getting the contours based on this documentation.
Thanks