Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to remove line when new bar is in the way

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

    #16
    Hello Jesse

    Ah yes, that was exactly what I was looking for, thank you.

    You never addressed my opacity setting question though so here it is again.


    For the opacity setting that you suggested, would there still be a way for the user to pick the color, or will the color have to be hardcoded now with only the opacity amount coming through as a custom user input?

    Comment


      #17
      Hello timoting,

      I did address this in post #13, The short answer would be that you need to make a user input for the opacity and then make the brush in your code which uses that opacity. You can still use the existing brush picker for the color but if you wanted additional opacity you need to make a new brush using your opacity input.

      After making the brush you could then pass the brush to a drawing object for it to be used. The link I provided shows how to Freeze() a brush so it will not cause errors.




      I look forward to being of further assistance.

      Comment


        #18
        Hello Jesse,

        There must be some misunderstanding on my part. The following is the example from the link you posted.

        Code:
        MyBrush = new SolidColorBrush(Color.FromArgb(100,  56, 120, 153));
        myBrush.Freeze();
        
        Draw.Line(this, "tag1", true, 10, 1000, 0, 1001, m yBrush, DashStyleHelper.Dot, 2);
        To my understanding, you're saying that I can create an user input for the opacity value, which is the A part of Argb. But what about the values of the rgb? How would I pass the color from the brush picker that's being picked from the user to the correct rgb values for the custom brush?

        Comment


          #19
          Hllo timoting,

          You could use ARGB or also use the Opacity property on the brush, that sample is really just showing how to Freeze brushes. Brushes are a standard C# concept so you can create a WPF brush in any of the supported C# ways. One way is to just pass the brushes Color to the SolidColorBrush:



          Code:
          MyBrush = new SolidColorBrush(myInputBrush.Color);
          MyBrush.Opacity = 1;
          MyBrush.Freeze();

          I look forward to being of further assistance.

          Comment


            #20
            Hello Jesse,

            Ah, yes that was the bit of information that I wasn't aware of. I managed to get it working,
            With that final bit of code, I think I can say that my indicator is now finished. I want to sincerely thank you for helping me get this far

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            637 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            366 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            572 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X