Turning to the dark side of inking = UnprocessedInput

Published May 06 2020 08:51 AM 1,275 Views
Microsoft

We learned how to draw on an InkCanvas and 'convert' the lines drawn into nice polished XAML lines with the previous article Use the UWP Inking platform as input for advanced scenarios. Let's go further and implement a "cut the lines" functionality in order to be able to divide a line in two lines like we would do using a scissor ✂.

 

 

Initial code for handling inking and creating XAML Lines

For the starting point, we take the sample code related to the article we just mentioned before.

As a reminder, we have two canvas:

  • One InkCanvas for accepting the drawings.
  • One Canvas for the resulting XAML Shapes.
<InkCanvas x:Name="inkCanvas" />
<Canvas x:Name="ShapesCanvas" />

The code behind for 'converting' strokes is displayed below. When the user finishes to draw a line (StrokesCollected event), we create a XAML Line with the same origin and end as the stroke. Then, we add this XAML line to the canvas and remove the stroke:

public MainPage()
{
   this.InitializeComponent();

   // Initialize the InkCanvas
   inkCanvas.InkPresenter.InputDeviceTypes =
      Windows.UI.Core.CoreInputDeviceTypes.Mouse |
      Windows.UI.Core.CoreInputDeviceTypes.Pen |
      Windows.UI.Core.CoreInputDeviceTypes.Touch;

   // When the user finished to draw something on the InkCanvas
   inkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
}

private void InkPresenter_StrokesCollected(
   Windows.UI.Input.Inking.InkPresenter sender,
   Windows.UI.Input.Inking.InkStrokesCollectedEventArgs args)
{
   InkStroke stroke = inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Last();

   Line line = ConvertStrokeToXAMLLine(stroke);
   ShapesCanvas.Children.Add(line);

   // We delete the InkStroke from the InkCanvas
   stroke.Selected = true;
   inkCanvas.InkPresenter.StrokeContainer.DeleteSelected();
}

private Line ConvertStrokeToXAMLLine(InkStroke stroke)
{
   var line = new Line();
   line.Stroke = new SolidColorBrush(Windows.UI.Colors.Green);
   line.StrokeThickness = 6;
   // The origin = (X1, Y1)
   line.X1 = stroke.GetInkPoints().First().Position.X;
   line.Y1 = stroke.GetInkPoints().First().Position.Y;
   // The end = (X2, Y2)
   line.X2 = stroke.GetInkPoints().Last().Position.X;
   line.Y2 = stroke.GetInkPoints().Last().Position.Y;

   return line;
}

Here is the initial application:

Initial windows displaying strokes converted in XAML linesInitial windows displaying strokes converted in XAML lines

 

We can start now!

 

 

The idea: Use the inking input to be able to 'cut' lines

We have the InkCanvas there, ready to accept pen/mouse/touch inputs. It would be great if we could leverage on it to accept interaction for drawing our 'cutting line'. The InkCanvas allows us to do it with UnprocessedInput.

 

The idea is to allow the InkCanvas to take input (we would like the user to draw a line to cut the XAML lines) but we do not flow this input to the InkPresenter to display the default digital ink. Instead, this input is handled only by our code.

Let's first modify the XAML in order to add a toggle switch to change the input mode between "allow inking" and "cut lines". To do so, we add a grid with two lines. The first line takes the ToogleSwitch control and adapts its height based on the height of the button. The second line takes all the remaining space of the window and shows the two canvas (Let's put the LightGray background color for this line):

<Grid>
	<Grid.RowDefinitions>
		<RowDefinition Height="Auto"></RowDefinition>
		<RowDefinition></RowDefinition>
	</Grid.RowDefinitions>


	<Grid Grid.Row="0">
		<ToggleSwitch x:Name="cutAShapeToggleSwitch"
			OffContent="Cut lines Off"
			OnContent="Cut lines On"
			Toggled="ToggleSwitch_Toggled"/>
	</Grid>


	<Grid Grid.Row="1" Background="LightGray">

		<Canvas x:Name="ShapesCanvas" />
		<InkCanvas x:Name="inkCanvas" />
	</Grid>
</Grid>

The ToggleSwitch is 'off' by default with the OffContent text displayed. If we toggle the control, it will be 'on' and will display the OnContent text. And so on... We get the toggle's changes in the code behind with the ToggleSwitch_Toggled event handler:

private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e)
{
   ToggleSwitch toggleSwitch = sender as ToggleSwitch;

   if (toggleSwitch.IsOn == true)
   {
      // We go to the "cut the lines" mode
   }
   else
   {
      // We go back to normal
   }
}

 

 

UnprocessedInput unleashed

How can we switch to the "cut the lines" mode and 'take the control' of the inputs? Simply by modifying the inking processing behavior and not accept inputs for inking or erasing. This is done by modifying the InputProcessingConfiguration property of the InkPresenter:

inkCanvas.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.None;

Now, as the inking is not processed anymore, we have to do it with our code. We have three events to handle for this:

  • PointerPressed - Every drawing starts with this event. It allows us to execute an initialization code when the user start to draw. Typically, we initiate a XAML Shapes that we will modify for every movement of the pen/touch/mouse.
  • PointerMoved - This event is raised when the user is drawing on the InkCanvas. We can then handle the input and draw or modify some XAML Shapes to follow the input's changes for example.
  • PointerReleased - When the user finished the drawing i.e. when the device surface is not touched anymore, we consider the drawing finished. We can decide to perform actions like selecting/modifying shapes or launch a shapes/character recognition.
inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += 
    UnprocessedInput_PointerPressed;
inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += 
    UnprocessedInput_PointerMoved;
inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += 
    UnprocessedInput_PointerReleased;

 

 

The "cut the lines" visual feedback

Let's start: When the user toggle 'on', we want to be in teh "cut the lines" mode:

  • We put the InputProcessingConfiguration.Mode to InkInputProcessingMode.None.
  • We go to UnprocessedInput by handling the three events.
private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e)
{
	ToggleSwitch toggleSwitch = sender as ToggleSwitch;

	var p = inkCanvas.InkPresenter;
	if (toggleSwitch.IsOn == true)
	{
		// We are not in the inking or erasing mode 
		// ==> Inputs are redirected to UnprocessedInput
		// i.e. Our code will take care of the inking inputs
		p.InputProcessingConfiguration.Mode = InkInputProcessingMode.None;

		p.UnprocessedInput.PointerPressed += UnprocessedInput_PointerPressed;
		p.UnprocessedInput.PointerMoved += UnprocessedInput_PointerMoved;
		p.UnprocessedInput.PointerReleased += UnprocessedInput_PointerReleased;
	}
	else
	{
		// Go back to normal which is the inking mode
		// ==> We can draw lines on the InkCanvas
		inkCanvas.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.Inking;

		// Remove the handlers for UnprocessedInput
		p.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed;
		p.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved;
		p.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased;
	}
}

When the user starts to draw the 'cutting line', we are in the PointerPressed event handler. Here are the actions we do:

  • We create a XAML Polyline which allows us to 'draw' connected straight lines to display a dotted scissor line: lasso = new Polyline().
  • The Polyline will be a red dotted line like "- - -". This is what means the DoubleCollection() { 2, 2 } for the StrokeDashArray property.
  • The initial position of the finger/mouse/pen is used for the polyline: lasso.Points.Add(args.CurrentPoint.RawPosition);.
  • Lastly, the polyline is added to the canvas by using ShapesCanvas.Children.Add(lasso);.
// The lasso is used to cut the lines when we switch to UnprocessedInput
private Polyline lasso;
private void UnprocessedInput_PointerPressed(
    InkUnprocessedInput sender,
    Windows.UI.Core.PointerEventArgs args)
{
	lasso = new Polyline()
	{
		Stroke = new SolidColorBrush(Windows.UI.Colors.Red),
		StrokeThickness = 2,
		StrokeDashArray = new DoubleCollection() { 2, 2 }
	};

	lasso.Points.Add(args.CurrentPoint.RawPosition);
	ShapesCanvas.Children.Add(lasso);
}

For intermediate changes, when the user is drawing, it is pretty straightforward: We just add an additional point to the polyline:

private void UnprocessedInput_PointerMoved(
    InkUnprocessedInput sender, 
    Windows.UI.Core.PointerEventArgs args)
{
	lasso.Points.Add(args.CurrentPoint.RawPosition);
}
 

 

The "cut the lines" ending code

When the 'cutting line' drawn is finished, we have some work:

  • For each single XAML line of the canvas, we have to detect if it was cut or not. If the line was cut, we have to replace it by the two corresponding lines. This implies finding the intersection point and create the first resulting line from the origin to the intersection point and the second line for the intersection point to the end. Finally, we remove the original line which was cut.
  • Remove the 'cutting line' (the lasso variable) from the canvas because we do not need it anymore.
private void UnprocessedInput_PointerReleased(
    InkUnprocessedInput sender,
    Windows.UI.Core.PointerEventArgs args)
{
	lasso.Points.Add(args.CurrentPoint.RawPosition);
	
	// For each line of the Canvas, we look for an intersection
	// If any, we replace the line which has been cut by the two lines
	
	ShapesCanvas.Children.Remove(lasso);
}

 

 

Finding the intersections

To be honest, this part of the job was the most difficult. I first tried to make calculations with a sheet of paper and a pencil. I do not know if I would have been able to build an algorithm but I switched quickly to my second option which was do a search on Internet. And guess what! I found that a person named Rod Stephens were providing the exact code I need! Unbelievable! I contacted Rod and he said Yes: "Feel free to use the code and explanation". Thank you very much Rod! :call_me_hand:

You can find the original blog post of Rod at this url: Determine where two lines intersect in C# - http://csharphelper.com/blog/2014/08/determine-where-two-lines-intersect-in-c/.

Here is the function I used in my project.

  • p1, p2, p3, p4 are points with (X,Y) coordinates.
  • This function is used for each line of the canvas. The line goes from p1 to p2.
  • The 'cutting line' goes from p3 to p4.
  • segments_intersect is the boolean we get indicating if the line was cut or not.
  • intersection is the intersection point we will use to create the two new lines based on the line which was cut.

Note: There are extra parameters that we do not use in our sample application. You may need them based on your needs. So we chose to not change the signature of the function.

// Code provided by Rod Stephens
// at http://csharphelper.com/blog/2014/08/determine-where-two-lines-intersect-in-c/
// Find the point of intersection between
// the lines p1 --> p2 and p3 --> p4.
private void FindIntersection(
	PointF p1, PointF p2, PointF p3, PointF p4,
	out bool lines_intersect, out bool segments_intersect,
	out PointF intersection,
	out PointF close_p1, out PointF close_p2)
{
	// Get the segments' parameters.
	float dx12 = p2.X - p1.X;
	float dy12 = p2.Y - p1.Y;
	float dx34 = p4.X - p3.X;
	float dy34 = p4.Y - p3.Y;

	// Solve for t1 and t2
	float denominator = (dy12 * dx34 - dx12 * dy34);

	float t1 =
		((p1.X - p3.X) * dy34 + (p3.Y - p1.Y) * dx34)
			/ denominator;
	if (float.IsInfinity(t1))
	{
		// The lines are parallel (or close enough to it).
		lines_intersect = false;
		segments_intersect = false;
		intersection = new PointF(float.NaN, float.NaN);
		close_p1 = new PointF(float.NaN, float.NaN);
		close_p2 = new PointF(float.NaN, float.NaN);
		return;
	}
	lines_intersect = true;

	float t2 =
		((p3.X - p1.X) * dy12 + (p1.Y - p3.Y) * dx12)
			/ -denominator;

	// Find the point of intersection.
	intersection = new PointF(p1.X + dx12 * t1, p1.Y + dy12 * t1);

	// The segments intersect if t1 and t2 are between 0 and 1.
	segments_intersect =
		((t1 >= 0) && (t1 <= 1) &&
			(t2 >= 0) && (t2 <= 1));

	// Find the closest points on the segments.
	if (t1 < 0)
	{
		t1 = 0;
	}
	else if (t1 > 1)
	{
		t1 = 1;
	}

	if (t2 < 0)
	{
		t2 = 0;
	}
	else if (t2 > 1)
	{
		t2 = 1;
	}

	close_p1 = new PointF(p1.X + dx12 * t1, p1.Y + dy12 * t1);
	close_p2 = new PointF(p3.X + dx34 * t2, p3.Y + dy34 * t2);
}

 

 

The "cut the lines" ending code revealed

Let's put all the pieces together for effectively cutting all the lines which were intercepted.

 

Note: Of course you can do extra work to cut only one line and stop the UnprocessedInput code to check when a line is encoutered and cut.

In our application, we decided to cut all lines for which we have an intersection with the 'cutting line' (the lasso). Here are the steps:

  • Take notes about all the new lines we create. We use the linesToAdd list that we populate.
  • The foreach (Line line in ShapesCanvas.Children.OfType<Line>()) { } loop allows to perform the intersection check on every single XAML Line Shapes in the canvas.
  • The FindIntersection function is called for each XAML line.
  • We verify if there is an intersection with the boolean SegmentIntersection.
  • If yes, we call the CutTheLine function that we will describe later.
  • Finally, all the new lines are added to the canvas and we remove the lasso.
private void UnprocessedInput_PointerReleased(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
	lasso.Points.Add(args.CurrentPoint.RawPosition);

	List<Line> linesToAdd = new List<Line>();

	foreach (Line line in ShapesCanvas.Children.OfType<Line>())
	{
		bool LineIntersection = false;
		bool SegmentIntersection = false;
		PointF IntersectionPoint;
		PointF p2;
		PointF p3;
		FindIntersection(
			// The line in the canvas
			new PointF((float)line.X1, (float)line.Y1), 
			new PointF((float)line.X2, (float)line.Y2),
					
			// The 'cutting line'
			new PointF((float)lasso.Points.First().X, (float)lasso.Points.First().Y),
			new PointF((float)lasso.Points.Last().X, (float)lasso.Points.Last().Y), 
					
			out LineIntersection,

			// Indicate if there is an intersection
			out SegmentIntersection, 
					
			// The intersection point
			out IntersectionPoint, 
					
			out p2, out p3);
				
		if (SegmentIntersection)
		{
			List<Line> lines = CutTheLine(line, IntersectionPoint);
			linesToAdd.AddRange(lines);
		}
	}

	foreach (Line line in linesToAdd)
	{
		ShapesCanvas.Children.Add(line);
	}

	ShapesCanvas.Children.Remove(lasso);
}

 

 

Cutting the line

We have done the most complex work so far. Cutting the line is the easiest action to do when we have the original line and the intersection point:

  • The first new line goes from the origin of the original line to the intersection
  • The second new line goes from the intersection to the end of the original line

We just change the color for fun and to be able to distinguish the two resulting lines.

 

In an upcoming article, we will draw some 'anchors' to the line. It is another way to identify two distinct lines

private List<Line> CutTheLine(Line lineToCut, PointF intersection)
{
	List<Line> lines = new List<Line>();

	var line1 = new Line();
	line1.Stroke = new SolidColorBrush(Windows.UI.Colors.DarkOrange);
	line1.StrokeThickness = 3;
	line1.X1 = lineToCut.X1;
	line1.Y1 = lineToCut.Y1;
	line1.X2 = intersection.X;
	line1.Y2 = intersection.Y;

	var line2 = new Line();
	line2.Stroke = new SolidColorBrush(Windows.UI.Colors.DarkViolet);
	line2.StrokeThickness = 3;
	line2.X1 = intersection.X;
	line2.Y1 = intersection.Y;
	line2.X2 = lineToCut.X2;
	line2.Y2 = lineToCut.Y2;

	lines.Add(line1);
	lines.Add(line2);

	return lines;
}

F I N A L L Y, we made it! Yes! Yes! We M A D E it! =)

All the source code is available on GitHub - https://github.com/microsoft/Windows-AppConsult-Samples-UWP/

You want to see it in action? Look:

Window with the 'cut the lines' functionalityWindow with the 'cut the lines' functionality

 

 

Wrapping up

UnprocessedInput is the key to be able to use the Inking inputs for performing advanced actions on strokes or XAML Shapes. We used it for 'cutting' lines but think about that you would be able to select shapes by intersecting them. We could imagine also putting points on a surface and when we press a extra button, we joint all the points to create a complex shape, etc..

 

@sbovo for the AppConsult team.

 

 

Inking series' articles

This article is part of a series exploring concepts about inking and XAML Shapes. Here are all links:

  1. Use the UWP Inking platform as input for advanced scenarios

  2. Handling zoom in Inking applications

  3. Turning to the dark side of inking = UnprocessedInput ⇐ You are here

  4. Free your mind: Start manipulating XAML Shapes

 

 

References

%3CLINGO-SUB%20id%3D%22lingo-sub-1364331%22%20slang%3D%22en-US%22%3ETurning%20to%20the%20dark%20side%20of%20inking%20%3D%20UnprocessedInput%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1364331%22%20slang%3D%22en-US%22%3E%3CDIV%20id%3D%22MainContent%22%3E%0A%3CP%3EWe%20learned%20how%20to%20draw%20on%20an%20InkCanvas%20and%20'convert'%20the%20lines%20drawn%20into%20nice%20polished%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2FWindows.UI.Xaml.Shapes.Line%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EXAML%20lines%3C%2FA%3E%20with%20the%20previous%20article%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-dev-appconsult%2Fuse-the-uwp-inking-platform-as-input-for-advanced-scenarios%2Fba-p%2F1352471%22%20target%3D%22_blank%22%3EUse%20the%20UWP%20Inking%20platform%20as%20input%20for%20advanced%20scenarios%3C%2FA%3E.%20Let's%20go%20further%20and%20implement%20a%20%22cut%20the%20lines%22%20functionality%20in%20order%20to%20be%20able%20to%20divide%20a%20line%20in%20two%20lines%20like%20we%20would%20do%20using%20a%20scissor%20%E2%9C%82.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22initial-code-for-handling-inking-and-creating-xaml-lines%22%20id%3D%22toc-hId--1353544785%22%20id%3D%22toc-hId--1353544785%22%3E%3CA%20id%3D%22pragma-line-4%22%20target%3D%22_blank%22%3E%3C%2FA%3EInitial%20code%20for%20handling%20inking%20and%20creating%20XAML%20Lines%3C%2FH2%3E%0A%3CP%3EFor%20the%20starting%20point%2C%20we%20take%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fsbovo%2FUWP-Advanced-Inking%2Ftree%2Fmaster%2FStrokesToShapes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esample%20code%3C%2FA%3E%20related%20to%20the%20article%20we%20just%20mentioned%20before.%3C%2FP%3E%0A%3CP%3EAs%20a%20reminder%2C%20we%20have%20two%20canvas%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-8%22%3E%0A%3CLI%20id%3D%22pragma-line-8%22%3EOne%20InkCanvas%20for%20accepting%20the%20drawings.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-9%22%3EOne%20Canvas%20for%20the%20resulting%20XAML%20Shapes.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-11%22%20class%3D%22language-csharp%20hljs%22%3E%3CINKCANVAS%20name%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%22inkCanvas%22%20%2F%26gt%3B%0A%3CCANVAS%20name%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%22ShapesCanvas%22%20%2F%26gt%3B%0A%3C%2FCANVAS%3E%3C%2FINKCANVAS%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EThe%20code%20behind%20for%20'converting'%20strokes%20is%20displayed%20below.%20When%20the%20user%20finishes%20to%20draw%20a%20line%20(%3CEM%3EStrokesCollected%3C%2FEM%3E%20event)%2C%20we%20create%20a%20XAML%20Line%20with%20the%20same%20origin%20and%20end%20as%20the%20stroke.%20Then%2C%20we%20add%20this%20XAML%20line%20to%20the%20canvas%20and%20remove%20the%20stroke%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-17%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EMainPage%3C%2FSPAN%3E()%3C%2FSPAN%3E%0A%7B%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ethis%3C%2FSPAN%3E.InitializeComponent()%3B%0A%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Initialize%20the%20InkCanvas%3C%2FSPAN%3E%0A%20%20%20inkCanvas.InkPresenter.InputDeviceTypes%20%3D%0A%20%20%20%20%20%20Windows.UI.Core.CoreInputDeviceTypes.Mouse%20%7C%0A%20%20%20%20%20%20Windows.UI.Core.CoreInputDeviceTypes.Pen%20%7C%0A%20%20%20%20%20%20Windows.UI.Core.CoreInputDeviceTypes.Touch%3B%0A%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20When%20the%20user%20finished%20to%20draw%20something%20on%20the%20InkCanvas%3C%2FSPAN%3E%0A%20%20%20inkCanvas.InkPresenter.StrokesCollected%20%2B%3D%20InkPresenter_StrokesCollected%3B%0A%7D%0A%0A%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EInkPresenter_StrokesCollected%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%0A%20%20%20Windows.UI.Input.Inking.InkPresenter%20sender%2C%0A%20%20%20Windows.UI.Input.Inking.InkStrokesCollectedEventArgs%20args%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20%20%20InkStroke%20stroke%20%3D%20inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Last()%3B%0A%0A%20%20%20Line%20line%20%3D%20ConvertStrokeToXAMLLine(stroke)%3B%0A%20%20%20ShapesCanvas.Children.Add(line)%3B%0A%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20We%20delete%20the%20InkStroke%20from%20the%20InkCanvas%3C%2FSPAN%3E%0A%20%20%20stroke.Selected%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Etrue%3C%2FSPAN%3E%3B%0A%20%20%20inkCanvas.InkPresenter.StrokeContainer.DeleteSelected()%3B%0A%7D%0A%0A%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20Line%20%3CSPAN%20class%3D%22hljs-title%22%3EConvertStrokeToXAMLLine%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3EInkStroke%20stroke%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evar%3C%2FSPAN%3E%20line%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20Line()%3B%0A%20%20%20line.Stroke%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20SolidColorBrush(Windows.UI.Colors.Green)%3B%0A%20%20%20line.StrokeThickness%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E6%3C%2FSPAN%3E%3B%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20origin%20%3D%20(X1%2C%20Y1)%3C%2FSPAN%3E%0A%20%20%20line.X1%20%3D%20stroke.GetInkPoints().First().Position.X%3B%0A%20%20%20line.Y1%20%3D%20stroke.GetInkPoints().First().Position.Y%3B%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20end%20%3D%20(X2%2C%20Y2)%3C%2FSPAN%3E%0A%20%20%20line.X2%20%3D%20stroke.GetInkPoints().Last().Position.X%3B%0A%20%20%20line.Y2%20%3D%20stroke.GetInkPoints().Last().Position.Y%3B%0A%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ereturn%3C%2FSPAN%3E%20line%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EHere%20is%20the%20initial%20application%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22InitialProject.gif%22%20style%3D%22width%3A%20534px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F189512i6F16343B7087922B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22InitialProject.gif%22%20alt%3D%22Initial%20windows%20displaying%20strokes%20converted%20in%20XAML%20lines%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EInitial%20windows%20displaying%20strokes%20converted%20in%20XAML%20lines%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20start%20now!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22the-idea-use-the-inking-input-to-be-able-to-cut-lines%22%20id%3D%22toc-hId-1133968048%22%20id%3D%22toc-hId-1133968048%22%3E%3CA%20id%3D%22pragma-line-68%22%20target%3D%22_blank%22%3E%3C%2FA%3EThe%20idea%3A%20Use%20the%20inking%20input%20to%20be%20able%20to%20'cut'%20lines%3C%2FH2%3E%0A%3CP%3EWe%20have%20the%20InkCanvas%20there%2C%20ready%20to%20accept%20pen%2Fmouse%2Ftouch%20inputs.%20It%20would%20be%20great%20if%20we%20could%20leverage%20on%20it%20to%20accept%20interaction%20for%20drawing%20our%20'cutting%20line'.%20The%20InkCanvas%20allows%20us%20to%20do%20it%20with%20%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkpresenter.unprocessedinput%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EUnprocessedInput%3C%2FA%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%20id%3D%22pragma-line-70%22%3E%0A%3CP%3EThe%20idea%20is%20to%20allow%20the%20InkCanvas%20to%20take%20input%20(we%20would%20like%20the%20user%20to%20draw%20a%20line%20to%20cut%20the%20XAML%20lines)%20but%20we%20do%20not%20flow%20this%20input%20to%20the%20InkPresenter%20to%20display%20the%20default%20digital%20ink.%20Instead%2C%20this%20input%20is%20handled%20only%20by%20our%20code.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3ELet's%20first%20modify%20the%20XAML%20in%20order%20to%20add%20a%20toggle%20switch%20to%20change%20the%20input%20mode%20between%20%22allow%20inking%22%20and%20%22cut%20lines%22.%20To%20do%20so%2C%20we%20add%20a%20grid%20with%20two%20lines.%20The%20first%20line%20takes%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Ffr-fr%2Fuwp%2Fapi%2Fwindows.ui.xaml.controls.toggleswitch%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EToogleSwitch%3C%2FA%3E%20control%20and%20adapts%20its%20height%20based%20on%20the%20height%20of%20the%20button.%20The%20second%20line%20takes%20all%20the%20remaining%20space%20of%20the%20window%20and%20shows%20the%20two%20canvas%20(Let's%20put%20the%20LightGray%20background%20color%20for%20this%20line)%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-75%22%20class%3D%22language-csharp%20hljs%22%3E%3CGRID%3E%0A%20%3CGRID.ROWDEFINITIONS%3E%0A%20%20%3CROWDEFINITION%20height%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%22Auto%22%26gt%3B%3C%2FROWDEFINITION%3E%0A%20%20%3CROWDEFINITION%3E%3C%2FROWDEFINITION%3E%0A%20%3C%2FGRID.ROWDEFINITIONS%3E%0A%0A%0A%20%3CGRID%20grid.row%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%220%22%26gt%3B%0A%20%20%3CTOGGLESWITCH%20name%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%22cutAShapeToggleSwitch%22%0A%20%20%20OffContent%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22Cut%20lines%20Off%22%3C%2FSPAN%3E%0A%20%20%20OnContent%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22Cut%20lines%20On%22%3C%2FSPAN%3E%0A%20%20%20Toggled%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22ToggleSwitch_Toggled%22%3C%2FSPAN%3E%2F%26gt%3B%0A%20%3C%2FTOGGLESWITCH%3E%0A%0A%0A%20%3CGRID%20grid.row%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%221%22%20Background%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22LightGray%22%3C%2FSPAN%3E%26gt%3B%0A%0A%20%20%3CCANVAS%20name%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%22ShapesCanvas%22%20%2F%26gt%3B%0A%20%20%3CINKCANVAS%20name%3D%22%26lt%3BSPAN%22%20class%3D%22hljs-string%22%3E%22inkCanvas%22%20%2F%26gt%3B%0A%20%3C%2FINKCANVAS%3E%0A%3C%2FCANVAS%3E%0A%3C%2FGRID%3E%3C%2FGRID%3E%3C%2FGRID%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EThe%20ToggleSwitch%20is%20'off'%20by%20default%20with%20the%20%3CEM%3EOffContent%3C%2FEM%3E%20text%20displayed.%20If%20we%20toggle%20the%20control%2C%20it%20will%20be%20'on'%20and%20will%20display%20the%20%3CEM%3EOnContent%3C%2FEM%3E%20text.%20And%20so%20on...%20We%20get%20the%20toggle's%20changes%20in%20the%20code%20behind%20with%20the%20%3CEM%3EToggleSwitch_Toggled%3C%2FEM%3E%20event%20handler%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-100%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EToggleSwitch_Toggled%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eobject%3C%2FSPAN%3E%20sender%2C%20RoutedEventArgs%20e%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20%20%20ToggleSwitch%20toggleSwitch%20%3D%20sender%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eas%3C%2FSPAN%3E%20ToggleSwitch%3B%0A%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(toggleSwitch.IsOn%20%3D%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Etrue%3C%2FSPAN%3E)%0A%20%20%20%7B%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20We%20go%20to%20the%20%22cut%20the%20lines%22%20mode%3C%2FSPAN%3E%0A%20%20%20%7D%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eelse%3C%2FSPAN%3E%0A%20%20%20%7B%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20We%20go%20back%20to%20normal%3C%2FSPAN%3E%0A%20%20%20%7D%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22unprocessedinput-unleashed%22%20id%3D%22toc-hId--673486415%22%20id%3D%22toc-hId--673486415%22%3E%3CA%20id%3D%22pragma-line-116%22%20target%3D%22_blank%22%3E%3C%2FA%3EUnprocessedInput%20unleashed%3C%2FH2%3E%0A%3CP%3EHow%20can%20we%20switch%20to%20the%20%22cut%20the%20lines%22%20mode%20and%20'take%20the%20control'%20of%20the%20inputs%3F%20Simply%20by%20modifying%20the%20inking%20processing%20behavior%20and%20not%20accept%20inputs%20for%20inking%20or%20erasing.%20This%20is%20done%20by%20modifying%20the%20%3CEM%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkpresenter.inputprocessingconfiguration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInputProcessingConfiguration%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FEM%3E%20property%20of%20the%20InkPresenter%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-118%22%20class%3D%22language-csharp%20hljs%22%3EinkCanvas.InkPresenter.InputProcessingConfiguration.Mode%20%3D%20InkInputProcessingMode.None%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ENow%2C%20as%20the%20inking%20is%20not%20processed%20anymore%2C%20we%20have%20to%20do%20it%20with%20our%20code.%20We%20have%20three%20events%20to%20handle%20for%20this%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-124%22%3E%0A%3CLI%20id%3D%22pragma-line-124%22%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointerpressed%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPointerPressed%3C%2FA%3E%3C%2FSTRONG%3E%20-%20Every%20drawing%20starts%20with%20this%20event.%20It%20allows%20us%20to%20execute%20an%20initialization%20code%20when%20the%20user%20start%20to%20draw.%20Typically%2C%20we%20initiate%20a%20XAML%20Shapes%20that%20we%20will%20modify%20for%20every%20movement%20of%20the%20pen%2Ftouch%2Fmouse.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-125%22%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointermoved%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPointerMoved%3C%2FA%3E%3C%2FSTRONG%3E%20-%20This%20event%20is%20raised%20when%20the%20user%20is%20drawing%20on%20the%20InkCanvas.%20We%20can%20then%20handle%20the%20input%20and%20draw%20or%20modify%20some%20XAML%20Shapes%20to%20follow%20the%20input's%20changes%20for%20example.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-126%22%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointerreleased%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPointerReleased%3C%2FA%3E%3C%2FSTRONG%3E%20-%20When%20the%20user%20finished%20the%20drawing%20i.e.%20when%20the%20device%20surface%20is%20not%20touched%20anymore%2C%20we%20consider%20the%20drawing%20finished.%20We%20can%20decide%20to%20perform%20actions%20like%20selecting%2Fmodifying%20shapes%20or%20launch%20a%20shapes%2Fcharacter%20recognition.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-127%22%20class%3D%22language-csharp%20hljs%22%3EinkCanvas.InkPresenter.UnprocessedInput.PointerPressed%20%2B%3D%20%0A%20%20%20%20UnprocessedInput_PointerPressed%3B%0AinkCanvas.InkPresenter.UnprocessedInput.PointerMoved%20%2B%3D%20%0A%20%20%20%20UnprocessedInput_PointerMoved%3B%0AinkCanvas.InkPresenter.UnprocessedInput.PointerReleased%20%2B%3D%20%0A%20%20%20%20UnprocessedInput_PointerReleased%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22the-cut-the-lines-visual-feedback%22%20id%3D%22toc-hId-1814026418%22%20id%3D%22toc-hId-1814026418%22%3E%3CA%20id%3D%22pragma-line-136%22%20target%3D%22_blank%22%3E%3C%2FA%3EThe%20%22cut%20the%20lines%22%20visual%20feedback%3C%2FH2%3E%0A%3CP%3ELet's%20start%3A%20When%20the%20user%20toggle%20'on'%2C%20we%20want%20to%20be%20in%20teh%20%22cut%20the%20lines%22%20mode%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-138%22%3E%0A%3CLI%20id%3D%22pragma-line-138%22%3EWe%20put%20the%20%3CEM%3EInputProcessingConfiguration.Mode%3C%2FEM%3E%20to%20%3CEM%3EInkInputProcessingMode.None%3C%2FEM%3E.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-139%22%3EWe%20go%20to%20%3CEM%3EUnprocessedInput%3C%2FEM%3E%20by%20handling%20the%20three%20events.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-141%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EToggleSwitch_Toggled%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eobject%3C%2FSPAN%3E%20sender%2C%20RoutedEventArgs%20e%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20ToggleSwitch%20toggleSwitch%20%3D%20sender%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eas%3C%2FSPAN%3E%20ToggleSwitch%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evar%3C%2FSPAN%3E%20p%20%3D%20inkCanvas.InkPresenter%3B%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(toggleSwitch.IsOn%20%3D%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Etrue%3C%2FSPAN%3E)%0A%20%7B%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20We%20are%20not%20in%20the%20inking%20or%20erasing%20mode%20%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20%3D%3D%26gt%3B%20Inputs%20are%20redirected%20to%20UnprocessedInput%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20i.e.%20Our%20code%20will%20take%20care%20of%20the%20inking%20inputs%3C%2FSPAN%3E%0A%20%20p.InputProcessingConfiguration.Mode%20%3D%20InkInputProcessingMode.None%3B%0A%0A%20%20p.UnprocessedInput.PointerPressed%20%2B%3D%20UnprocessedInput_PointerPressed%3B%0A%20%20p.UnprocessedInput.PointerMoved%20%2B%3D%20UnprocessedInput_PointerMoved%3B%0A%20%20p.UnprocessedInput.PointerReleased%20%2B%3D%20UnprocessedInput_PointerReleased%3B%0A%20%7D%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eelse%3C%2FSPAN%3E%0A%20%7B%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Go%20back%20to%20normal%20which%20is%20the%20inking%20mode%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20%3D%3D%26gt%3B%20We%20can%20draw%20lines%20on%20the%20InkCanvas%3C%2FSPAN%3E%0A%20%20inkCanvas.InkPresenter.InputProcessingConfiguration.Mode%20%3D%20InkInputProcessingMode.Inking%3B%0A%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Remove%20the%20handlers%20for%20UnprocessedInput%3C%2FSPAN%3E%0A%20%20p.UnprocessedInput.PointerPressed%20-%3D%20UnprocessedInput_PointerPressed%3B%0A%20%20p.UnprocessedInput.PointerMoved%20-%3D%20UnprocessedInput_PointerMoved%3B%0A%20%20p.UnprocessedInput.PointerReleased%20-%3D%20UnprocessedInput_PointerReleased%3B%0A%20%7D%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EWhen%20the%20user%20starts%20to%20draw%20the%20'cutting%20line'%2C%20we%20are%20in%20the%20%3CEM%3EPointerPressed%3C%2FEM%3E%20event%20handler.%20Here%20are%20the%20actions%20we%20do%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-174%22%3E%0A%3CLI%20id%3D%22pragma-line-174%22%3EWe%20create%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.xaml.shapes.polyline%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EXAML%20Polyline%3C%2FA%3E%20which%20allows%20us%20to%20'draw'%20connected%20straight%20lines%20to%20display%20a%20dotted%20scissor%20line%3A%20%3CCODE%3Elasso%20%3D%20new%20Polyline()%3C%2FCODE%3E.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-175%22%3EThe%20Polyline%20will%20be%20a%20red%20dotted%20line%20like%20%22-%20-%20-%22.%20This%20is%20what%20means%20the%20%3CCODE%3EDoubleCollection()%20%7B%202%2C%202%20%7D%3C%2FCODE%3E%20for%20the%20%3CEM%3EStrokeDashArray%3C%2FEM%3E%20property.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-176%22%3EThe%20initial%20position%20of%20the%20finger%2Fmouse%2Fpen%20is%20used%20for%20the%20polyline%3A%20%3CCODE%3Elasso.Points.Add(args.CurrentPoint.RawPosition)%3B%3C%2FCODE%3E.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-177%22%3ELastly%2C%20the%20polyline%20is%20added%20to%20the%20canvas%20by%20using%20%3CCODE%3EShapesCanvas.Children.Add(lasso)%3B%3C%2FCODE%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-179%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20lasso%20is%20used%20to%20cut%20the%20lines%20when%20we%20switch%20to%20UnprocessedInput%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20Polyline%20lasso%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-184%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EUnprocessedInput_PointerPressed%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%0A%20%20%20%20InkUnprocessedInput%20sender%2C%0A%20%20%20%20Windows.UI.Core.PointerEventArgs%20args%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20lasso%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20Polyline()%0A%20%7B%0A%20%20Stroke%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20SolidColorBrush(Windows.UI.Colors.Red)%2C%0A%20%20StrokeThickness%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E2%3C%2FSPAN%3E%2C%0A%20%20StrokeDashArray%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20DoubleCollection()%20%7B%20%3CSPAN%20class%3D%22hljs-number%22%3E2%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22hljs-number%22%3E2%3C%2FSPAN%3E%20%7D%0A%20%7D%3B%0A%0A%20lasso.Points.Add(args.CurrentPoint.RawPosition)%3B%0A%20ShapesCanvas.Children.Add(lasso)%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EFor%20intermediate%20changes%2C%20when%20the%20user%20is%20drawing%2C%20it%20is%20pretty%20straightforward%3A%20We%20just%20add%20an%20additional%20point%20to%20the%20polyline%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-203%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EUnprocessedInput_PointerMoved%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%0A%20%20%20%20InkUnprocessedInput%20sender%2C%20%0A%20%20%20%20Windows.UI.Core.PointerEventArgs%20args%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20lasso.Points.Add(args.CurrentPoint.RawPosition)%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CDIV%20id%3D%22tinyMceEditorSebastien%20Bovo_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22the-cut-the-lines-ending-code%22%20id%3D%22toc-hId-6571955%22%20id%3D%22toc-hId-6571955%22%3E%3CA%20id%3D%22pragma-line-216%22%20target%3D%22_blank%22%3E%3C%2FA%3EThe%20%22cut%20the%20lines%22%20ending%20code%3C%2FH2%3E%0A%3CP%3EWhen%20the%20'cutting%20line'%20drawn%20is%20finished%2C%20we%20have%20some%20work%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-218%22%3E%0A%3CLI%20id%3D%22pragma-line-218%22%3EFor%20each%20single%20XAML%20line%20of%20the%20canvas%2C%20we%20have%20to%20detect%20if%20it%20was%20cut%20or%20not.%20If%20the%20line%20was%20cut%2C%20we%20have%20to%20replace%20it%20by%20the%20two%20corresponding%20lines.%20This%20implies%20finding%20the%20intersection%20point%20and%20create%20the%20first%20resulting%20line%20from%20the%20origin%20to%20the%20intersection%20point%20and%20the%20second%20line%20for%20the%20intersection%20point%20to%20the%20end.%20Finally%2C%20we%20remove%20the%20original%20line%20which%20was%20cut.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-219%22%3ERemove%20the%20'cutting%20line'%20(the%20%3CCODE%3Elasso%3C%2FCODE%3E%20variable)%20from%20the%20canvas%20because%20we%20do%20not%20need%20it%20anymore.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-222%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EUnprocessedInput_PointerReleased%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%0A%20%20%20%20InkUnprocessedInput%20sender%2C%0A%20%20%20%20Windows.UI.Core.PointerEventArgs%20args%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20lasso.Points.Add(args.CurrentPoint.RawPosition)%3B%0A%20%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20For%20each%20line%20of%20the%20Canvas%2C%20we%20look%20for%20an%20intersection%3C%2FSPAN%3E%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20If%20any%2C%20we%20replace%20the%20line%20which%20has%20been%20cut%20by%20the%20two%20lines%3C%2FSPAN%3E%0A%20%0A%20ShapesCanvas.Children.Remove(lasso)%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22finding-the-intersections%22%20id%3D%22toc-hId--1800882508%22%20id%3D%22toc-hId--1800882508%22%3E%3CA%20id%3D%22pragma-line-240%22%20target%3D%22_blank%22%3E%3C%2FA%3EFinding%20the%20intersections%3C%2FH2%3E%0A%3CP%3ETo%20be%20honest%2C%20this%20part%20of%20the%20job%20was%20the%20most%20difficult.%20I%20first%20tried%20to%20make%20calculations%20with%20a%20sheet%20of%20paper%20and%20a%20pencil.%20I%20do%20not%20know%20if%20I%20would%20have%20been%20able%20to%20build%20an%20algorithm%20but%20I%20switched%20quickly%20to%20my%20second%20option%20which%20was%20do%20a%20search%20on%20Internet.%20And%20guess%20what!%20I%20found%20that%20a%20person%20named%20%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Frod-stephens-4461641%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ERod%20Stephens%3C%2FA%3E%20were%20providing%20the%20exact%20code%20I%20need!%20Unbelievable!%20I%20contacted%20Rod%20and%20he%20said%20Yes%3A%20%22Feel%20free%20to%20use%20the%20code%20and%20explanation%22.%20Thank%20you%20very%20much%20Rod!%20%3Acall_me_hand%3A%3C%2FP%3E%0A%3CP%3EYou%20can%20find%20the%20original%20blog%20post%20of%20Rod%20at%20this%20url%3A%20Determine%20where%20two%20lines%20intersect%20in%20C%23%20-%20%3CA%20href%3D%22http%3A%2F%2Fcsharphelper.com%2Fblog%2F2014%2F08%2Fdetermine-where-two-lines-intersect-in-c%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttp%3A%2F%2Fcsharphelper.com%2Fblog%2F2014%2F08%2Fdetermine-where-two-lines-intersect-in-c%2F%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20function%20I%20used%20in%20my%20project.%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-246%22%3E%0A%3CLI%20id%3D%22pragma-line-246%22%3Ep1%2C%20p2%2C%20p3%2C%20p4%20are%20points%20with%20(X%2CY)%20coordinates.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-247%22%3EThis%20function%20is%20used%20for%20each%20line%20of%20the%20canvas.%20The%20line%20goes%20from%20p1%20to%20p2.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-248%22%3EThe%20'cutting%20line'%20goes%20from%20p3%20to%20p4.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-249%22%3E%3CCODE%3Esegments_intersect%3C%2FCODE%3E%20is%20the%20boolean%20we%20get%20indicating%20if%20the%20line%20was%20cut%20or%20not.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-250%22%3E%3CCODE%3Eintersection%3C%2FCODE%3E%20is%20the%20intersection%20point%20we%20will%20use%20to%20create%20the%20two%20new%20lines%20based%20on%20the%20line%20which%20was%20cut.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBLOCKQUOTE%20id%3D%22pragma-line-252%22%3E%0A%3CP%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20There%20are%20extra%20parameters%20that%20we%20do%20not%20use%20in%20our%20sample%20application.%20You%20may%20need%20them%20based%20on%20your%20needs.%20So%20we%20chose%20to%20not%20change%20the%20signature%20of%20the%20function.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-254%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Code%20provided%20by%20Rod%20Stephens%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20at%20http%3A%2F%2Fcsharphelper.com%2Fblog%2F2014%2F08%2Fdetermine-where-two-lines-intersect-in-c%2F%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Find%20the%20point%20of%20intersection%20between%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20the%20lines%20p1%20--%26gt%3B%20p2%20and%20p3%20--%26gt%3B%20p4.%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EFindIntersection%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3E%0A%20PointF%20p1%2C%20PointF%20p2%2C%20PointF%20p3%2C%20PointF%20p4%2C%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ebool%3C%2FSPAN%3E%20lines_intersect%2C%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ebool%3C%2FSPAN%3E%20segments_intersect%2C%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20PointF%20intersection%2C%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20PointF%20close_p1%2C%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20PointF%20close_p2%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Get%20the%20segments'%20parameters.%3C%2FSPAN%3E%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20dx12%20%3D%20p2.X%20-%20p1.X%3B%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20dy12%20%3D%20p2.Y%20-%20p1.Y%3B%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20dx34%20%3D%20p4.X%20-%20p3.X%3B%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20dy34%20%3D%20p4.Y%20-%20p3.Y%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Solve%20for%20t1%20and%20t2%3C%2FSPAN%3E%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20denominator%20%3D%20(dy12%20*%20dx34%20-%20dx12%20*%20dy34)%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20t1%20%3D%0A%20%20((p1.X%20-%20p3.X)%20*%20dy34%20%2B%20(p3.Y%20-%20p1.Y)%20*%20dx34)%0A%20%20%20%2F%20denominator%3B%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.IsInfinity(t1))%0A%20%7B%0A%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20lines%20are%20parallel%20(or%20close%20enough%20to%20it).%3C%2FSPAN%3E%0A%20%20lines_intersect%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%3B%0A%20%20segments_intersect%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%3B%0A%20%20intersection%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.NaN%2C%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.NaN)%3B%0A%20%20close_p1%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.NaN%2C%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.NaN)%3B%0A%20%20close_p2%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.NaN%2C%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E.NaN)%3B%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ereturn%3C%2FSPAN%3E%3B%0A%20%7D%0A%20lines_intersect%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Etrue%3C%2FSPAN%3E%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E%20t2%20%3D%0A%20%20((p3.X%20-%20p1.X)%20*%20dy12%20%2B%20(p1.Y%20-%20p3.Y)%20*%20dx12)%0A%20%20%20%2F%20-denominator%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Find%20the%20point%20of%20intersection.%3C%2FSPAN%3E%0A%20intersection%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF(p1.X%20%2B%20dx12%20*%20t1%2C%20p1.Y%20%2B%20dy12%20*%20t1)%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20segments%20intersect%20if%20t1%20and%20t2%20are%20between%200%20and%201.%3C%2FSPAN%3E%0A%20segments_intersect%20%3D%0A%20%20((t1%20%26gt%3B%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E0%3C%2FSPAN%3E)%20%26amp%3B%26amp%3B%20(t1%20%26lt%3B%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E)%20%26amp%3B%26amp%3B%0A%20%20%20(t2%20%26gt%3B%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E0%3C%2FSPAN%3E)%20%26amp%3B%26amp%3B%20(t2%20%26lt%3B%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E))%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Find%20the%20closest%20points%20on%20the%20segments.%3C%2FSPAN%3E%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(t1%20%26lt%3B%20%3CSPAN%20class%3D%22hljs-number%22%3E0%3C%2FSPAN%3E)%0A%20%7B%0A%20%20t1%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E0%3C%2FSPAN%3E%3B%0A%20%7D%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eelse%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(t1%20%26gt%3B%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E)%0A%20%7B%0A%20%20t1%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E%3B%0A%20%7D%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(t2%20%26lt%3B%20%3CSPAN%20class%3D%22hljs-number%22%3E0%3C%2FSPAN%3E)%0A%20%7B%0A%20%20t2%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E0%3C%2FSPAN%3E%3B%0A%20%7D%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eelse%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(t2%20%26gt%3B%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E)%0A%20%7B%0A%20%20t2%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E%3B%0A%20%7D%0A%0A%20close_p1%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF(p1.X%20%2B%20dx12%20*%20t1%2C%20p1.Y%20%2B%20dy12%20*%20t1)%3B%0A%20close_p2%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF(p3.X%20%2B%20dx34%20*%20t2%2C%20p3.Y%20%2B%20dy34%20*%20t2)%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22the-cut-the-lines-ending-code-revealed%22%20id%3D%22toc-hId-686630325%22%20id%3D%22toc-hId-686630325%22%3E%3CA%20id%3D%22pragma-line-326%22%20target%3D%22_blank%22%3E%3C%2FA%3EThe%20%22cut%20the%20lines%22%20ending%20code%20revealed%3C%2FH2%3E%0A%3CP%3ELet's%20put%20all%20the%20pieces%20together%20for%20effectively%20cutting%20all%20the%20lines%20which%20were%20intercepted.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%20id%3D%22pragma-line-328%22%3E%0A%3CP%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20Of%20course%20you%20can%20do%20extra%20work%20to%20cut%20only%20one%20line%20and%20stop%20the%20UnprocessedInput%20code%20to%20check%20when%20a%20line%20is%20encoutered%20and%20cut.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EIn%20our%20application%2C%20we%20decided%20to%20cut%20all%20lines%20for%20which%20we%20have%20an%20intersection%20with%20the%20'cutting%20line'%20(the%20lasso).%20Here%20are%20the%20steps%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-331%22%3E%0A%3CLI%20id%3D%22pragma-line-331%22%3ETake%20notes%20about%20all%20the%20new%20lines%20we%20create.%20We%20use%20the%20%3CCODE%3ElinesToAdd%3C%2FCODE%3E%20list%20that%20we%20populate.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-332%22%3EThe%20%3CCODE%3Eforeach%20(Line%20line%20in%20ShapesCanvas.Children.OfType%3CLINE%3E())%20%7B%20%7D%3C%2FLINE%3E%3C%2FCODE%3E%20loop%20allows%20to%20perform%20the%20intersection%20check%20on%20every%20single%20XAML%20Line%20Shapes%20in%20the%20canvas.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-333%22%3EThe%20%3CCODE%3EFindIntersection%3C%2FCODE%3E%20function%20is%20called%20for%20each%20XAML%20line.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-334%22%3EWe%20verify%20if%20there%20is%20an%20intersection%20with%20the%20boolean%20%3CCODE%3ESegmentIntersection%3C%2FCODE%3E.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-335%22%3EIf%20yes%2C%20we%20call%20the%20%3CCODE%3ECutTheLine%3C%2FCODE%3E%20function%20that%20we%20will%20describe%20later.%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-336%22%3EFinally%2C%20all%20the%20new%20lines%20are%20added%20to%20the%20canvas%20and%20we%20remove%20the%20lasso.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-338%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evoid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-title%22%3EUnprocessedInput_PointerReleased%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3EInkUnprocessedInput%20sender%2C%20Windows.UI.Core.PointerEventArgs%20args%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%7B%0A%20lasso.Points.Add(args.CurrentPoint.RawPosition)%3B%0A%0A%20List%3CLINE%3E%20linesToAdd%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20List%3CLINE%3E()%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eforeach%3C%2FSPAN%3E%20(Line%20line%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ein%3C%2FSPAN%3E%20ShapesCanvas.Children.OfType%3CLINE%3E())%0A%20%7B%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ebool%3C%2FSPAN%3E%20LineIntersection%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%3B%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ebool%3C%2FSPAN%3E%20SegmentIntersection%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%3B%0A%20%20PointF%20IntersectionPoint%3B%0A%20%20PointF%20p2%3B%0A%20%20PointF%20p3%3B%0A%20%20FindIntersection(%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20line%20in%20the%20canvas%3C%2FSPAN%3E%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF((%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)line.X1%2C%20(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)line.Y1)%2C%20%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF((%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)line.X2%2C%20(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)line.Y2)%2C%0A%20%20%20%20%20%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20'cutting%20line'%3C%2FSPAN%3E%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF((%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)lasso.Points.First().X%2C%20(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)lasso.Points.First().Y)%2C%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20PointF((%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)lasso.Points.Last().X%2C%20(%3CSPAN%20class%3D%22hljs-keyword%22%3Efloat%3C%2FSPAN%3E)lasso.Points.Last().Y)%2C%20%0A%20%20%20%20%20%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20LineIntersection%2C%0A%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20Indicate%20if%20there%20is%20an%20intersection%3C%2FSPAN%3E%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20SegmentIntersection%2C%20%0A%20%20%20%20%20%0A%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%2F%2F%20The%20intersection%20point%3C%2FSPAN%3E%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20IntersectionPoint%2C%20%0A%20%20%20%20%20%0A%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20p2%2C%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eout%3C%2FSPAN%3E%20p3)%3B%0A%20%20%20%20%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eif%3C%2FSPAN%3E%20(SegmentIntersection)%0A%20%20%7B%0A%20%20%20List%3CLINE%3E%20lines%20%3D%20CutTheLine(line%2C%20IntersectionPoint)%3B%0A%20%20%20linesToAdd.AddRange(lines)%3B%0A%20%20%7D%0A%20%7D%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Eforeach%3C%2FSPAN%3E%20(Line%20line%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ein%3C%2FSPAN%3E%20linesToAdd)%0A%20%7B%0A%20%20ShapesCanvas.Children.Add(line)%3B%0A%20%7D%0A%0A%20ShapesCanvas.Children.Remove(lasso)%3B%0A%7D%0A%3C%2FLINE%3E%3C%2FLINE%3E%3C%2FLINE%3E%3C%2FLINE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22cutting-the-line%22%20id%3D%22toc-hId--1120824138%22%20id%3D%22toc-hId--1120824138%22%3E%3CA%20id%3D%22pragma-line-389%22%20target%3D%22_blank%22%3E%3C%2FA%3ECutting%20the%20line%3C%2FH2%3E%0A%3CP%3EWe%20have%20done%20the%20most%20complex%20work%20so%20far.%20Cutting%20the%20line%20is%20the%20easiest%20action%20to%20do%20when%20we%20have%20the%20original%20line%20and%20the%20intersection%20point%3A%3C%2FP%3E%0A%3CUL%20id%3D%22pragma-line-391%22%3E%0A%3CLI%20id%3D%22pragma-line-391%22%3EThe%20first%20new%20line%20goes%20from%20the%20origin%20of%20the%20original%20line%20to%20the%20intersection%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-392%22%3EThe%20second%20new%20line%20goes%20from%20the%20intersection%20to%20the%20end%20of%20the%20original%20line%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWe%20just%20change%20the%20color%20for%20fun%20and%20to%20be%20able%20to%20distinguish%20the%20two%20resulting%20lines.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%20id%3D%22pragma-line-396%22%3E%0A%3CP%3EIn%20an%20upcoming%20article%2C%20we%20will%20draw%20some%20'anchors'%20to%20the%20line.%20It%20is%20another%20way%20to%20identify%20two%20distinct%20lines%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-399%22%20class%3D%22language-csharp%20hljs%22%3E%3CSPAN%20class%3D%22hljs-function%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eprivate%3C%2FSPAN%3E%20List%3CLINE%3E%20%3CSPAN%20class%3D%22hljs-title%22%3ECutTheLine%3C%2FSPAN%3E(%3CSPAN%20class%3D%22hljs-params%22%3ELine%20lineToCut%2C%20PointF%20intersection%3C%2FSPAN%3E)%3C%2FLINE%3E%3C%2FSPAN%3E%0A%7B%0A%20List%3CLINE%3E%20lines%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20List%3CLINE%3E()%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evar%3C%2FSPAN%3E%20line1%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20Line()%3B%0A%20line1.Stroke%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20SolidColorBrush(Windows.UI.Colors.DarkOrange)%3B%0A%20line1.StrokeThickness%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E3%3C%2FSPAN%3E%3B%0A%20line1.X1%20%3D%20lineToCut.X1%3B%0A%20line1.Y1%20%3D%20lineToCut.Y1%3B%0A%20line1.X2%20%3D%20intersection.X%3B%0A%20line1.Y2%20%3D%20intersection.Y%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Evar%3C%2FSPAN%3E%20line2%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20Line()%3B%0A%20line2.Stroke%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3Enew%3C%2FSPAN%3E%20SolidColorBrush(Windows.UI.Colors.DarkViolet)%3B%0A%20line2.StrokeThickness%20%3D%20%3CSPAN%20class%3D%22hljs-number%22%3E3%3C%2FSPAN%3E%3B%0A%20line2.X1%20%3D%20intersection.X%3B%0A%20line2.Y1%20%3D%20intersection.Y%3B%0A%20line2.X2%20%3D%20lineToCut.X2%3B%0A%20line2.Y2%20%3D%20lineToCut.Y2%3B%0A%0A%20lines.Add(line1)%3B%0A%20lines.Add(line2)%3B%0A%0A%20%3CSPAN%20class%3D%22hljs-keyword%22%3Ereturn%3C%2FSPAN%3E%20lines%3B%0A%7D%0A%3C%2FLINE%3E%3C%2FLINE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EF%20I%20N%20A%20L%20L%20Y%2C%20we%20made%20it!%20Yes!%20Yes!%20We%20M%20A%20D%20E%20it!%20%3D)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3EAll%20the%20source%20code%20is%20available%20on%20GitHub%20-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fsbovo%2FUWP-Advanced-Inking%2Ftree%2Fmaster%2FUnprocessedInput%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fsbovo%2FUWP-Advanced-Inking%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EYou%20want%20to%20see%20it%20in%20action%3F%20Look%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22CutLine02.gif%22%20style%3D%22width%3A%20544px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F189519iC7B3DF06CBCA8138%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22CutLine02.gif%22%20alt%3D%22Window%20with%20the%20'cut%20the%20lines'%20functionality%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EWindow%20with%20the%20'cut%20the%20lines'%20functionality%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorSebastien%20Bovo_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CH2%20id%3D%22wrapping-up%22%20id%3D%22toc-hId-1366688695%22%20id%3D%22toc-hId-1366688695%22%3E%3CA%20id%3D%22pragma-line-439%22%20target%3D%22_blank%22%3E%3C%2FA%3EWrapping%20up%3C%2FH2%3E%0A%3CP%3E%3CSTRONG%3EUnprocessedInput%3C%2FSTRONG%3E%20is%20the%20key%20to%20be%20able%20to%20use%20the%20Inking%20inputs%20for%20performing%20advanced%20actions%20on%20strokes%20or%20XAML%20Shapes.%20We%20used%20it%20for%20'cutting'%20lines%20but%20think%20about%20that%20you%20would%20be%20able%20to%20select%20shapes%20by%20intersecting%20them.%20We%20could%20imagine%20also%20putting%20points%20on%20a%20surface%20and%20when%20we%20press%20a%20extra%20button%2C%20we%20joint%20all%20the%20points%20to%20create%20a%20complex%20shape%2C%20etc..%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fsbovo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3E%40sbovo%3C%2FA%3E%20for%20the%20AppConsult%20team.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22inking-series-articles%22%20id%3D%22toc-hId--440765768%22%20id%3D%22toc-hId--440765768%22%3E%3CA%20id%3D%22pragma-line-446%22%20target%3D%22_blank%22%3E%3C%2FA%3EInking%20series'%20articles%3C%2FH2%3E%0A%3CP%3EThis%20article%20is%20part%20of%20a%20series%20exploring%20concepts%20about%20inking%20and%20XAML%20Shapes.%20Here%20are%20all%20links%3A%3C%2FP%3E%0A%3COL%20id%3D%22pragma-line-448%22%3E%0A%3CLI%20id%3D%22pragma-line-448%22%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-dev-appconsult%2Fuse-the-uwp-inking-platform-as-input-for-advanced-scenarios%2Fba-p%2F1352471%22%20target%3D%22_blank%22%3EUse%20the%20UWP%20Inking%20platform%20as%20input%20for%20advanced%20scenarios%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-449%22%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-dev-appconsult%2Fhandling-zoom-in-inking-applications%2Fba-p%2F1354930%22%20target%3D%22_blank%22%3EHandling%20zoom%20in%20Inking%20applications%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-451%22%3E%0A%3CP%3E%3CSTRONG%3ETurning%20to%20the%20dark%20side%20of%20inking%20%3D%20UnprocessedInput%3C%2FSTRONG%3E%20%E2%87%90%20You%20are%20here%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22references%22%20id%3D%22toc-hId--574450492%22%20id%3D%22toc-hId--574450492%22%3E%3CA%20id%3D%22pragma-line-453%22%20target%3D%22_blank%22%3E%3C%2FA%3EReferences%3C%2FH2%3E%0A%3CUL%20id%3D%22pragma-line-454%22%3E%0A%3CLI%20id%3D%22pragma-line-454%22%3E%3CSTRONG%3EToogleSwitch%3C%2FSTRONG%3E%20control%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.xaml.controls.toggleswitch%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.xaml.controls.toggleswitch%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-455%22%3EInkPresenter.%3CSTRONG%3EUnprocessedInput%3C%2FSTRONG%3E%20Property%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkpresenter.unprocessedinput%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkpresenter.unprocessedinput%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-456%22%3EInputProcessingConfiguration%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkpresenter.inputprocessingconfiguration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkpresenter.inputprocessingconfiguration%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-457%22%3EInkUnprocessedInput.%3CSTRONG%3EPointerPressed%3C%2FSTRONG%3E%20Event%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointerpressed%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointerpressed%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-458%22%3EInkUnprocessedInput.%3CSTRONG%3EPointerMoved%3C%2FSTRONG%3E%20Event%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointermoved%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointermoved%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-459%22%3EInkUnprocessedInput.%3CSTRONG%3EPointerReleased%3C%2FSTRONG%3E%20Event%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointerreleased%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.input.inking.inkunprocessedinput.pointerreleased%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-460%22%3EXAML%20Polyline%20-%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.xaml.shapes.polyline%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.ui.xaml.shapes.polyline%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%20id%3D%22pragma-line-461%22%3EDetermine%20where%20two%20lines%20intersect%20in%20C%23%20(by%20Rod%20Stephens)%20-%20%3CA%20href%3D%22http%3A%2F%2Fcsharphelper.com%2Fblog%2F2014%2F08%2Fdetermine-where-two-lines-intersect-in-c%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttp%3A%2F%2Fcsharphelper.com%2Fblog%2F2014%2F08%2Fdetermine-where-two-lines-intersect-in-c%2F%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1364331%22%20slang%3D%22en-US%22%3E%3CP%3ELet's%20go%20further%20and%20implement%20a%20%22cut%20the%20lines%22%20functionality%20in%20order%20to%20be%20able%20to%20divide%20a%20line%20in%20two%20lines%20like%20we%20would%20do%20using%20a%20scissor%20%E2%9C%82.%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Version history
Last update:
‎Jun 06 2020 09:06 AM
Updated by:
www.000webhost.com