First, Canvas
Layout controls for absolute positioning of neutron elements in WPF
Its child elements define the width and height of the element using width and height
Use Convas.left (convas.right), Convas.top (Convas.bottom) to define the relative position of the Convas container
If Convas.left and Convas.right, Convas.top and Convas.bottom are present at the same time, Convas.left, Convas.top takes precedence
For example:
1: <Canvas>
2: <Button Canvas.Left="10" Canvas.Top="10" Height="23" Width="75">LT</Button>
3: <Button Canvas.Right="10" Canvas.Top="10" Height="23" Width="75">RT</Button>
4: <Button Canvas.Left="10" Canvas.Bottom="10" Height="23" Width="75">LB</Button>
5: <Button Canvas.Right="10" Canvas.Bottom="10" Height="23" Width="75">RB</Button>
6: </Canvas>
When the form is resized, Lt stays the same as the left and the top distance, the RT stays the same as the right and the top, and the LB and the left and the lower distance remain unchanged, and RB is kept unchanged from the right and the lower distance. Using canvas is not a simple way to implement Acho functionality in Windows applications.
Second, InkCanvas
Implements controls that allow ink to be used in WPF. Such as:
1: <Window x:Class="WPFLayoutDemo.InkCanvasDemo"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation& quot;
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: Title="InkCanvasDemo" Height="200" Width="300">
5: <InkCanvas>
6: <InkCanvas.DefaultDrawingAttributes>
7: <DrawingAttributes Color="Red" />
8: </InkCanvas.DefaultDrawingAttributes>
9: <Image Width="155" Height="155" InkCanvas.Left="10" InkCanvas.Top="10"
10: Source="Logo2.png"/>
11: </InkCanvas>
12: </Window>
Other functions are similar to canvas.