Draw rectangle for draw commands
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
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
This discussion has been closed.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com