Drawing lines in code using C# and WPF

前端 未结 2 1917
盖世英雄少女心
盖世英雄少女心 2020-12-17 09:05

I\'m trying to create a digital clock display using 7 segment displays. I can draw lines in XAML by using code like this:



        
2条回答
  •  无人及你
    2020-12-17 09:22

    Is that your entire drawing code? If so, you need to add the line object to your surface. If you're using a Canvas for example:

    myCanvas.Children.Add(line);
    

    This will add your line to your canvas. At the moment, you're just creating the line but not putting it anywhere.

    You can find more information on drawing in WPF on this MSDN page.

提交回复
热议问题