Announcement

Collapse
No announcement yet.

Multi-line text scaling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multi-line text scaling

    Greetings,

    I have an application that draws 2 lines of text above certain bars. The first line can be drawn a tick or two above the high, bottom-aligned, that is, the bottom of the text is aligned with the tick value that is 2 ticks above the high. The problem is to figure out the y value of where to draw the 2nd line of text which should reside just on top of the first line of text. If the pixel height of the first line of text, was, say, 15 pixels, then I would want to draw the text perhaps 5 pixels above the top of the first line of text. But drawtext functions don't work with pixel relative values for y coordinates; rather they work with y values which are a function of the symbol on the chart. This application needs to work with any arbitrary symbol. The problem is further complicated because the user can 'scrunch' the y axis of the chart, compressing the two lines of text such that they overlap.

    I have developed a scaling algorithm that seems to work ok, but is far from a foolproof method. Am I missing the boat here? Is there an easy way to do this that I have overlooked?

    Tx,

    Scott
    Scott Masters
    www.tic2tic.com
    [email protected]

  • #2
    Scott
    If you are using version 7.9 you can use the new Text.PRESET and Location flags.
    For more information see this article in the EFS KnowledgeBase.
    Alex

    Comment


    • #3
      Thanks Alex...i'll test this new function. It would be nice if the function returned the y value of where it drew the text.

      Scott
      Scott Masters
      www.tic2tic.com
      [email protected]

      Comment


      • #4
        Alex,

        The new location flags in EFS2 sure did the trick. AWEsome. I've been looking for that capability for 2 years!

        Thanks again,

        Scott
        Scott Masters
        www.tic2tic.com
        [email protected]

        Comment

        Working...
        X