|
@@ -0,0 +1,139 @@
|
|
|
+<UserControl x:Class="compdfkit_tools.Edit.PDFImageEditControl"
|
|
|
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
+ xmlns:local="clr-namespace:compdfkit_tools.Edit"
|
|
|
+ xmlns:common="clr-namespace:compdfkit_tools.Common"
|
|
|
+ mc:Ignorable="d"
|
|
|
+ d:DesignHeight="450" d:DesignWidth="800" MinWidth="250" Padding="10">
|
|
|
+ <Grid>
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <TextBlock FontSize="20" FontWeight="Bold" HorizontalAlignment="Center">图片属性</TextBlock>
|
|
|
+
|
|
|
+ <Border Background="LightGray" Grid.Row="1" MinHeight="100" CornerRadius="5" Margin="0,10,0,0">
|
|
|
+ <Image Name="ImageThumbUI" MaxHeight="100" MaxWidth="230"></Image>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <!--图片旋转-->
|
|
|
+ <local:CPDFImageRotateUI x:Name="RotateUI" Grid.Row="2" FontSize="16" Margin="0,10,0,0"></local:CPDFImageRotateUI>
|
|
|
+
|
|
|
+ <!--图片翻转-->
|
|
|
+ <local:CPDFImageFlipUI x:Name="FlipUI" Grid.Row="3" FontSize="16" Margin="0,10,0,0"></local:CPDFImageFlipUI>
|
|
|
+
|
|
|
+ <!--透明度-->
|
|
|
+ <Grid Grid.Row="4" Margin="0,20,0,0">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ <RowDefinition Height="auto"></RowDefinition>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <TextBlock FontSize="16">透明度:</TextBlock>
|
|
|
+
|
|
|
+ <StackPanel Grid.Row="1" Orientation="Horizontal">
|
|
|
+ <Slider Width="150"
|
|
|
+ Name="ImageOpacitySlider"
|
|
|
+ Value="1"
|
|
|
+ IsSelectionRangeEnabled="True"
|
|
|
+ IsMoveToPointEnabled="True"
|
|
|
+ Margin="2,5,10,0"
|
|
|
+ Maximum="1"
|
|
|
+ Minimum="0"
|
|
|
+ TickFrequency="0.01"
|
|
|
+ IsSnapToTickEnabled="True"
|
|
|
+ Thumb.DragCompleted="SliderOpacity_DragCompleted"
|
|
|
+ Thumb.DragStarted="Slider_DragStarted"
|
|
|
+ ValueChanged="SliderOpacity_ValueChanged"
|
|
|
+ Tag="true"
|
|
|
+ />
|
|
|
+ <TextBox Name="ImageOpacityBox" Grid.Column="1" Margin="0,5,0,0" Height="20" Width="50"
|
|
|
+ VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
|
|
|
+ IsReadOnly="True">100%</TextBox>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+
|
|
|
+ <!--图片替换-->
|
|
|
+ <Grid Grid.Row="5" Margin="0,20,0,0">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock VerticalAlignment="Center" FontSize="16">图片替换:</TextBlock>
|
|
|
+ <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageReplaceBtn_Click">
|
|
|
+ <Button.Content>
|
|
|
+ <Path Fill="Gray">
|
|
|
+ <Path.Data>
|
|
|
+ M0.75 3.25C0.75 1.73122 1.98122 0.5 3.5 0.5H18.5C20.0188 0.5 21.25 1.73122 21.25 3.25V14.7511C21.25 16.2699 20.0188 17.5011 18.5
|
|
|
+ 17.5011H3.5C1.98122 17.5011 0.75 16.2699 0.75 14.7511V3.25ZM3.5 2C2.80964 2 2.25 2.55964 2.25 3.25V9.80764L4.62588 7.18104C5.29052
|
|
|
+ 6.44627 6.43205 6.40929 7.14284 7.09952L10.8426 10.6922C10.9226 10.7699 11.0443 10.7852 11.141 10.7298L14.8017 8.63369C15.3394 8.32578
|
|
|
+ 15.9999 8.32519 16.5382 8.63215L19.75 10.4637V3.25C19.75 2.55964 19.1904 2 18.5 2H3.5ZM19.75 12.1905L15.7951 9.93517C15.7182 9.89132
|
|
|
+ 15.6239 9.8914 15.547 9.93539L11.8864 12.0315C11.2093 12.4192 10.3574 12.3119 9.79764 11.7683L6.09787 8.17563C5.99633 8.07703 5.83325
|
|
|
+ 8.08231 5.7383 8.18728L2.25 12.0437V14.7511C2.25 15.4415 2.80964 16.0011 3.5 16.0011H18.5C19.1904 16.0011 19.75 15.4415 19.75
|
|
|
+ 14.7511V12.1905ZM17.2732 5.63378C17.2732 6.45448 16.6016 7.11979 15.7732 7.11979C14.9448 7.11979 14.2732 6.45448 14.2732 5.63378C14.2732
|
|
|
+ 4.81308 14.9448 4.14777 15.7732 4.14777C16.6016 4.14777 17.2732 4.81308 17.2732 5.63378Z
|
|
|
+ </Path.Data>
|
|
|
+ </Path>
|
|
|
+ </Button.Content>
|
|
|
+ </Button>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <!--图片导出-->
|
|
|
+ <Grid Grid.Row="6" Margin="0,10,0,0">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock VerticalAlignment="Center" FontSize="16">图片导出:</TextBlock>
|
|
|
+ <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageExportBtn_Click">
|
|
|
+ <Button.Content>
|
|
|
+ <Viewbox>
|
|
|
+ <Path Fill="Gray">
|
|
|
+ <Path.Data>
|
|
|
+ M903.872912 0H120.127088A120.127088 120.127088 0 0 0 0 120.127088v783.745824a120.127088 120.127088 0 0 0 120.127088 120.127088h783.745824a120.127088
|
|
|
+ 120.127088 0 0 0 120.127088-120.127088V120.127088A120.127088 120.127088 0 0 0 903.872912 0zM353.707536 278.628106l135.977189-135.97719a31.283096
|
|
|
+ 31.283096 0 0 1 44.213442 0l135.977189 135.97719A31.283096 31.283096 0 1 1 625.661914 322.841548l-83.421588-83.421589V717.425662a31.283096 31.283096
|
|
|
+ 0 0 1-62.566192 0V240.254175l-83.421588 83.421589a31.283096 31.283096 0 0 1-42.54501-45.047658zM871.755601 803.349898a87.17556 87.17556 0 0 1-87.17556
|
|
|
+ 87.17556H239.419959a87.17556 87.17556 0 0 1-87.17556-87.17556v-158.08391a31.283096 31.283096 0 0 1 62.566192 0v158.08391a24.609369 24.609369 0 0 0 24.609368
|
|
|
+ 24.609369h545.160082a24.609369 24.609369 0 0 0 24.609368-24.609369v-162.25499a31.283096 31.283096 0 0 1 62.566192 0z
|
|
|
+ </Path.Data>
|
|
|
+ </Path>
|
|
|
+ </Viewbox>
|
|
|
+ </Button.Content>
|
|
|
+ </Button>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <!--图片裁剪-->
|
|
|
+ <Grid Grid.Row="7" Margin="0,10,0,0">
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <TextBlock VerticalAlignment="Center" FontSize="16">图片裁剪:</TextBlock>
|
|
|
+ <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageClipBtn_Click">
|
|
|
+ <Button.Content>
|
|
|
+ <Path Fill="Gray">
|
|
|
+ <Path.Data>
|
|
|
+ M5.00786 2.39823C4.9582 2.03215 4.6444 1.75 4.26471 1.75C3.85049 1.75 3.51471 2.08579 3.51471 2.5V3.51471H2.5L2.39823 3.52155C2.03215 3.57121
|
|
|
+ 1.75 3.88501 1.75 4.26471L1.75685 4.36648C1.80651 4.73255 2.1203 5.01471 2.5 5.01471L3.51471 5.01465V15.7353L3.52155 15.8371C3.57121 16.2031
|
|
|
+ 3.88501 16.4853 4.26471 16.4853H14.9853L14.9853 17.5L14.9921 17.6018C15.0418 17.9678 15.3556 18.25 15.7353 18.25C16.1495 18.25 16.4853 17.9142
|
|
|
+ 16.4853 17.5V16.4853H17.5L17.6018 16.4784C17.9678 16.4288 18.25 16.115 18.25 15.7353L18.2432 15.6335C18.1935 15.2674 17.8797 14.9853 17.5
|
|
|
+ 14.9853L16.4853 14.9853V4.26471L16.4784 4.16294C16.4288 3.79686 16.115 3.51471 15.7353 3.51471H5.01465L5.01471 2.5L5.00786 2.39823ZM5.01456
|
|
|
+ 5.01456L5.014 14.985L14.9852 14.9852L14.985 5.014L5.01456 5.01456Z
|
|
|
+ </Path.Data>
|
|
|
+ </Path>
|
|
|
+ </Button.Content>
|
|
|
+ </Button>
|
|
|
+ </Grid>
|
|
|
+ </Grid>
|
|
|
+</UserControl>
|