PDA

View Full Version : text path points



amitpatel22
10th June 2011, 11:59
Hi..

How to find no. of point in Path of text.
As per as VC++ I used following code for getting no. of point.

// use a path to record how the text was drawn

pDC->BeginPath();
pDC->TextOut(10, 10, _T("Hockey is Best!"));
pDC->EndPath();

// for long strings or complex fonts, this number might be

int nNumPts = pDC->GetPath(NULL, NULL, 0);

// Allocate memory to hold points and stroke types from the path.

LPPOINT lpPoints = new POINT[nNumPts];
LPBYTE lpTypes = new BYTE[nNumPts];

// Now that we have the memory, really get the path data.

nNumPts = pDC->GetPath(lpPoints, lpTypes, nNumPts);
PolyDraw(pDC, lpPoints, lpTypes, nNumPts);

Waiting for quick reply..

Thanks..

Lesiok
10th June 2011, 13:38
QFontMetrics