Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```<Window x:Class="linie_wpf.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:linie_wpf"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Grid>
- <Canvas x:Name="canvas">
- <Path Stroke="Blue" StrokeThickness="2" Canvas.Top="148.02" HorizontalAlignment="Left" Stretch="Fill" Width="800" Height="138" RenderTransformOrigin="0.195,0.662" >
- <Path.Data>
- <PathGeometry>
- <PathGeometry.Figures>
- <PathFigureCollection>
- <PathFigure StartPoint="10,100">
- <PathFigure.Segments>
- <PathSegmentCollection>
- <BezierSegment Point1="100,0"
- Point2="200,200"
- Point3="300,100"
- />
- </PathSegmentCollection>
- </PathFigure.Segments>
- </PathFigure>
- </PathFigureCollection>
- </PathGeometry.Figures>
- </PathGeometry>
- </Path.Data>
- </Path>
- </Canvas>
- </Grid>
- </Window>
- ```
- ```
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace linie_wpf
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- Line l1=new Line();
- l1.X1 = 0;
- l1.X2 = 800;
- l1.Y1 = 225;
- l1.Y2 = 225;
- l1.Stroke =Brushes.Black;
- canvas.Children.Add(l1);
- Line l2 = new Line();
- l2.X1 = 400;
- l2.X2 = 400;
- l2.Y1 = 0;
- l2.Y2 = 450;
- l2.Stroke = Brushes.Black;
- canvas.Children.Add(l2);
- }
- }
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement