Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

Draw rectangle for draw commands

edited March 2010 in Devices
Hi,

I would like to know is there a property on the draw command where you can
get the x and y (left and top) values for the actual rectangle / canvas for
a piece of text?

i.e. You can read the left value for a specific piece of text but it may be
right aligned and i would like to know the starting point of that texts
column.

Thanks,

Anton

Comments

  • edited March 2010
    Hi Anton,

    The DrawCommand object only holds basic positional information about the
    text to be shown/printed. The device itself determines the alignment and
    adjusts the output accordingly. You can see this inside the
    DrawStandardText routine of the TppScreenDevice class located in the
    ppViewr.pas file. Near the end, you can see where the starting position is
    adjusted based on the alignment. You would need to do something similar to
    get the actual text position based on the DrawCommand position and size.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.