Skip to content

Commit bbedd0a

Browse files
committed
Update CropImageExample.xaml
1 parent c034022 commit bbedd0a

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

src/WPFDevelopers.Samples.Shared/ExampleViews/CropImageExample.xaml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@
1717
<RowDefinition Height="*" />
1818
<RowDefinition Height="Auto" />
1919
</Grid.RowDefinitions>
20-
<Grid.ColumnDefinitions>
21-
<ColumnDefinition />
22-
<ColumnDefinition />
23-
</Grid.ColumnDefinitions>
2420
<WrapPanel>
2521
<CheckBox
2622
x:Name="myCheckBox"
23+
wd:ElementHelper.CornerRadius="3"
2724
Content="开启等比缩放"
2825
IsChecked="False" />
29-
<StackPanel Orientation="Horizontal">
26+
<StackPanel Margin="10,0" Orientation="Horizontal">
3027
<TextBlock VerticalAlignment="Center" Text="裁剪区域比例:" />
3128
<Slider
3229
x:Name="myRectScaleSlider"
3330
Width="100"
31+
wd:ElementHelper.CornerRadius="3"
3432
Maximum="1"
3533
Minimum="0"
3634
Value="0.5" />
@@ -40,30 +38,23 @@
4038
<wd:CropImage
4139
Name="MyCropImage"
4240
Grid.Row="1"
43-
Grid.Column="0"
4441
IsRatioScale="{Binding ElementName=myCheckBox, Path=IsChecked}"
4542
RectScale="{Binding ElementName=myRectScaleSlider, Path=Value}"
4643
ScaleSize="2.35,1" />
47-
<Image
48-
Grid.Row="1"
49-
Grid.Column="1"
50-
Width="{Binding CurrentRect.Width, ElementName=MyCropImage}"
51-
Height="{Binding CurrentRect.Height, ElementName=MyCropImage}"
52-
VerticalAlignment="Center"
53-
Source="{Binding CurrentAreaBitmap, ElementName=MyCropImage}"
54-
Stretch="Uniform" />
5544
<StackPanel
5645
Grid.Row="2"
57-
Grid.ColumnSpan="2"
46+
Margin="0,10"
5847
HorizontalAlignment="Center"
48+
VerticalAlignment="Center"
49+
wd:PanelHelper.Spacing="3"
5950
Orientation="Horizontal">
6051
<Button
61-
Margin="0,20,10,20"
52+
wd:ElementHelper.CornerRadius="3"
6253
Click="OnImportClickHandler"
6354
Content="选择图片"
6455
Style="{StaticResource WD.PrimaryButton}" />
6556
<Button
66-
Margin="0,20,10,20"
57+
wd:ElementHelper.CornerRadius="3"
6758
Click="BtnSave_Click"
6859
Content="保存图片"
6960
Style="{StaticResource WD.SuccessPrimaryButton}" />

0 commit comments

Comments
 (0)