wpf 画图控件 InkCanvas控件
添加如下:
<Window x:Class="WpfApp4.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:WpfApp4"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="450" Width="800">
<Grid x:Name="MainPanel" Background="#FFD7E1E7">
<Grid.Resources>
<TransformGroup x:Key="ImageTransformResource">
<ScaleTransform />
<TranslateTransform />
</TransformGroup>
</Grid.Resources>
<Viewbox Stretch="Fill" Grid.RowSpan="2">
<Canvas Height="1077" Width="1920" RenderTransformOrigin="0.519,0.505" Background="#FFD7E1E7" >
<Button x:Name="pen" Height="59" Width="124" Canvas.Left="10">线笔</Button>
<Button x:Name="writer" Height="59" Width="124" Canvas.Left="137" Canvas.Top="-3">荧光笔</Button>
<Button x:Name="writingbrush" Height="59" Width="124" Canvas.Left="