Advertisement
programusy

Untitled

Mar 22nd, 2023
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. ```<Window x:Class="linie_wpf.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:linie_wpf"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9.  
  10.  
  11. <Grid>
  12. <Canvas x:Name="canvas">
  13. <Path Stroke="Blue" StrokeThickness="2" Canvas.Top="148.02" HorizontalAlignment="Left" Stretch="Fill" Width="800" Height="138" RenderTransformOrigin="0.195,0.662" >
  14. <Path.Data>
  15. <PathGeometry>
  16. <PathGeometry.Figures>
  17. <PathFigureCollection>
  18. <PathFigure StartPoint="10,100">
  19. <PathFigure.Segments>
  20. <PathSegmentCollection>
  21. <BezierSegment Point1="100,0"
  22. Point2="200,200"
  23. Point3="300,100"
  24. />
  25. </PathSegmentCollection>
  26. </PathFigure.Segments>
  27. </PathFigure>
  28. </PathFigureCollection>
  29. </PathGeometry.Figures>
  30. </PathGeometry>
  31. </Path.Data>
  32. </Path>
  33. </Canvas>
  34.  
  35. </Grid>
  36. </Window>
  37. ```
  38.  
  39.  
  40. ```
  41. using System;
  42. using System.Collections.Generic;
  43. using System.Linq;
  44. using System.Text;
  45. using System.Threading.Tasks;
  46. using System.Windows;
  47. using System.Windows.Controls;
  48. using System.Windows.Data;
  49. using System.Windows.Documents;
  50. using System.Windows.Input;
  51. using System.Windows.Media;
  52. using System.Windows.Media.Imaging;
  53. using System.Windows.Navigation;
  54. using System.Windows.Shapes;
  55.  
  56. namespace linie_wpf
  57. {
  58. /// <summary>
  59. /// Interaction logic for MainWindow.xaml
  60. /// </summary>
  61. public partial class MainWindow : Window
  62. {
  63. public MainWindow()
  64. {
  65. InitializeComponent();
  66. Line l1=new Line();
  67. l1.X1 = 0;
  68. l1.X2 = 800;
  69. l1.Y1 = 225;
  70. l1.Y2 = 225;
  71. l1.Stroke =Brushes.Black;
  72. canvas.Children.Add(l1);
  73. Line l2 = new Line();
  74. l2.X1 = 400;
  75. l2.X2 = 400;
  76. l2.Y1 = 0;
  77. l2.Y2 = 450;
  78. l2.Stroke = Brushes.Black;
  79.  
  80. canvas.Children.Add(l2);
  81.  
  82.  
  83.  
  84. }
  85. }
  86. }
  87. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement