I would like to calculate the pixel width of the text being rendered.
Is there a way to obtain the font information for drawing functions?
I want to draw a text to be left edge aligned at the last bar of the chart.
Something lie this:
Is there a way to obtain the font information for drawing functions?
I want to draw a text to be left edge aligned at the last bar of the chart.
Something lie this:
CODE:
Font font = GetTextDrawingFont(); Size size = System.Windows.Forms.TextRenderer.MeasureText(text, font); DrawTextVAlign(text, idx, bars.High[idx], VerticalAlignment.Top, WLColor.Red, font.Size, 0, -1 * size);
Rename
You can create a WLFont instance and pass it as one of the optional parameters to the DrawText methods. This will let you know the exact font.
I tried other fonts but preferred the default font, so I wondered how to retrieve the font currently set to the Draw functions.
The default font is "Arial".
Your Response
Post
Edit Post
Login is required