Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText, DrawTextlayout

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

    DrawText, DrawTextlayout

    Looking for a clear example on RenderTarget.DrawText, TextLayout. Trying to center text on a line in my drawing tool. Please point me to a good example as your docs don't yet have RenderTarget.DrawText

    #2
    Hello funk101,

    Thanks for your post.

    Please look at the Ruler tool as a good example of RenderTarget.DrawTextLayout. Line 358. Also, the Fibonacci tool, Text tool.

    Other references:
    http://sharpdx.org/documentation/api...get-drawtext-3
    http://sharpdx.org/documentation/api...drawtextlayout
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Paul - The URLs provided no longer available and wondering if there are any alternates.

      Looking for a way to center text around a "point".

      Though one can measure the height/length of the text and then adjust the point accordingly. Wanted to know if this can be done by any existing methods directly centered (both vertically & horizontally) around a point instead of performing own calculations.

      Would you please provide any example for this?

      thank you.
      Last edited by vking; 12-30-2015, 09:16 AM.

      Comment


        #4
        Hello vking,

        Thanks for your post.

        It appears SharpDX is in the process of reworking their website and their documentation is not yet available. Here is their home page: http://sharpdx.org/ where you can check their documentation link as it evolves.

        You might try working with SharpDX.DirectWrite.TextAlignment.Center
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Paul - Thanks for the reply.

          With any combination of Text Center - the text is not visible.

          TextFormat textFormat = chartControl.Properties.LabelFont.ToDirectWriteTex tFormat();
          textFormat.TextAlignment = SharpDX.DirectWrite.TextAlignment.Center;

          If I comment the last line - text is visible.

          Would you please see if you can provide a simple example with "SharpDX.DirectWrite.TextAlignment.Center"

          Thanks

          Comment


            #6
            Hello vking,

            Thanks for your post.

            Regrettably I do not have a simple example in sharpDX. You can review the indicator file SampleCustomPlot for an example of the text formatting and indeed try the different options within that. Centering may not be what you want, it was an off the cuff thought when I found the sharpDX website/help was not available.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              thanks Paul.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sidlercom80, Today, 04:45 AM
              0 responses
              1 view
              0 likes
              Last Post sidlercom80  
              Started by NT-Roland, Today, 04:44 AM
              0 responses
              3 views
              0 likes
              Last Post NT-Roland  
              Started by knarfoe, Today, 04:26 AM
              0 responses
              1 view
              0 likes
              Last Post knarfoe
              by knarfoe
               
              Started by manueldecastro, Yesterday, 10:59 PM
              2 responses
              8 views
              0 likes
              Last Post manueldecastro  
              Started by ttodua, 05-03-2019, 04:54 AM
              2 responses
              130 views
              0 likes
              Last Post ninZa
              by ninZa
               
              Working...
              X