Repository navigation
Expand file tree
/
Copy pathCropImageExample.xaml
More file actions
68 lines (67 loc) · 3.04 KB
/
Copy pathCropImageExample.xaml
File metadata and controls
68 lines (67 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<UserControl
x:Class="WPFDevelopers.Samples.ExampleViews.CropImageExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<WrapPanel>
<CheckBox
x:Name="myCheckBox"
wd:ElementHelper.CornerRadius="3"
Content="开启等比缩放"
IsChecked="False" />
<StackPanel Margin="10,0" Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="裁剪区域比例:" />
<Slider
x:Name="myRectScaleSlider"
Width="100"
wd:ElementHelper.CornerRadius="3"
Maximum="1"
Minimum="0"
Value="0.5" />
</StackPanel>
</WrapPanel>
<wd:CropImage
Name="MyCropImage"
Grid.Row="1"
IsRatioScale="{Binding ElementName=myCheckBox, Path=IsChecked}"
RectScale="{Binding ElementName=myRectScaleSlider, Path=Value}"
ScaleSize="2.35,1" />
<StackPanel
Grid.Row="2"
Margin="0,10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
wd:PanelHelper.Spacing="3"
Orientation="Horizontal">
<Button
wd:ElementHelper.CornerRadius="3"
Click="OnImportClickHandler"
Content="选择图片"
Style="{StaticResource WD.PrimaryButton}" />
<Button
wd:ElementHelper.CornerRadius="3"
Click="BtnSave_Click"
Content="保存图片"
Style="{StaticResource WD.SuccessPrimaryButton}" />
</StackPanel>
</Grid>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CropImageExample.xaml" CodeType="Xaml" />
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CropImageExample.xaml.cs" CodeType="CSharp" />
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>