Results 1 to 2 of 2

Thread: text path points

  1. #1
    Join Date
    Jun 2011
    Posts
    22
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default text path points

    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
    Qt Code:
    1. pDC->BeginPath();
    2. pDC->TextOut(10, 10, _T("Hockey is Best!"));
    3. pDC->EndPath();
    To copy to clipboard, switch view to plain text mode 

    // for long strings or complex fonts, this number might be
    Qt Code:
    1. int nNumPts = pDC->GetPath(NULL, NULL, 0);
    To copy to clipboard, switch view to plain text mode 

    // Allocate memory to hold points and stroke types from the path.
    Qt Code:
    1. LPPOINT lpPoints = new POINT[nNumPts];
    2. LPBYTE lpTypes = new BYTE[nNumPts];
    To copy to clipboard, switch view to plain text mode 

    // Now that we have the memory, really get the path data.
    Qt Code:
    1. nNumPts = pDC->GetPath(lpPoints, lpTypes, nNumPts);
    2. PolyDraw(pDC, lpPoints, lpTypes, nNumPts);
    To copy to clipboard, switch view to plain text mode 

    Waiting for quick reply..

    Thanks..

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: text path points


Similar Threads

  1. add points/path to QGraphicsView
    By szisziszilvi in forum Qt Programming
    Replies: 6
    Last Post: 13th January 2011, 13:35
  2. Replies: 1
    Last Post: 21st December 2010, 22:04
  3. Replies: 8
    Last Post: 17th October 2009, 08:10
  4. how to get item's text or path from QListVIew
    By Mystical Groovy in forum Qt Programming
    Replies: 4
    Last Post: 5th September 2008, 01:25
  5. Replies: 0
    Last Post: 14th December 2007, 01:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.