Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 06:15:24 +0000



How to place one text drawing at the end of another.

View Count: 726

[2015-11-06 13:19:16]
jesslinn - Posts: 108
I have a horizontal text panel (similar to a region data bar but more flexible).

Is there a way to accurately determine the end position of a text drawing and place another one at that point? Is it best to place the text using BeginIndex or BeginDateTime?

I can come close by getting the bar width in pixels using BarIndexToXPixelCoordinate on two adjacent bars and then estimating the pixels per point (1pt ~ 16px) and multiplying the string length, the font size, and the pixels per point, but I have not figured out quite the right formula to keep the panel as stable as the region data bar during spacing and scrolling events. It blinks during scrolling and resizes a little during bar spacing changes.
[2015-11-06 18:01:22]
Sierra Chart Engineering - Posts: 104368
Sounds like you might want to use direct GDI access:
https://www.sierrachart.com/index.php?page=doc/doc_ACSILProgrammingConcepts.html#CustomFreeFormDrawing

There is a Windows function to calculate the width of a text string. But there is no way to reliably use the results from ACSIL.

Using BeginIndex is faster when drawings are drawn.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2015-11-06 18:01:46

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account