PDFImageEditControl.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <UserControl x:Class="ComPDFKit.Controls.Edit.PDFImageEditControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ComPDFKit.Controls.Edit"
  7. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. mc:Ignorable="d"
  9. d:DesignHeight="720" d:DesignWidth="280" MinWidth="260" Padding="10"
  10. Background="#FAFCFF">
  11. <UserControl.Resources>
  12. <ResourceDictionary>
  13. <ResourceDictionary.MergedDictionaries>
  14. <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  15. <ResourceDictionary Source="../../../Asset/Styles/SliderStyle.xaml"></ResourceDictionary>
  16. </ResourceDictionary.MergedDictionaries>
  17. <common:PropertyPanelResourceConverter x:Key="PropertyPanelResourceConverter"></common:PropertyPanelResourceConverter>
  18. <common:CommonResourceConverter x:Key="CommonResourceConverter" />
  19. </ResourceDictionary>
  20. </UserControl.Resources>
  21. <ScrollViewer VerticalScrollBarVisibility="Auto">
  22. <Grid>
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="auto"></RowDefinition>
  25. <RowDefinition Height="auto"></RowDefinition>
  26. <RowDefinition Height="auto"></RowDefinition>
  27. <RowDefinition Height="auto"></RowDefinition>
  28. <RowDefinition Height="auto"></RowDefinition>
  29. <RowDefinition Height="auto"></RowDefinition>
  30. </Grid.RowDefinitions>
  31. <Border Background="White" Height="36">
  32. <TextBlock FontSize="14" FontWeight="Bold" HorizontalAlignment="Center" Foreground="#42464D" VerticalAlignment="Center" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_ImageProperty}"></TextBlock>
  33. </Border>
  34. <Border Name="ImageThumbBorder" Background="White" Grid.Row="1" MinHeight="100" CornerRadius="5" Margin="0,16,0,0" BorderThickness="1" BorderBrush="#E2E3E6">
  35. <Image Name="ImageThumbUI" MaxHeight="80" MaxWidth="230" Stretch="Uniform"></Image>
  36. </Border>
  37. <StackPanel Grid.Row="2" Margin="0,33,0,0" >
  38. <local:CPDFImageRotateUI x:Name="RotateUI" FontSize="16"></local:CPDFImageRotateUI>
  39. <Grid Margin="0,10,0,0">
  40. <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Rotation}" FontFamily="Microsoft YaHei" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  41. <TextBox Padding="5,0,5,0" x:Name="RotationTxb" HorizontalAlignment="Right" VerticalContentAlignment="Center" Width="110" Height="32" LostFocus="RotationTxb_LostFocus" PreviewKeyDown="RotationTxb_PreviewKeyDown"></TextBox>
  42. </Grid>
  43. </StackPanel>
  44. <local:CPDFImageFlipUI x:Name="FlipUI" Grid.Row="3" FontSize="16" Margin="0,10,0,0"></local:CPDFImageFlipUI>
  45. <Grid Grid.Row="4" Margin="0,20,0,0">
  46. <Grid.ColumnDefinitions>
  47. <ColumnDefinition Width="*"></ColumnDefinition>
  48. <ColumnDefinition Width="auto"></ColumnDefinition>
  49. </Grid.ColumnDefinitions>
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="auto"></RowDefinition>
  52. <RowDefinition Height="auto"></RowDefinition>
  53. </Grid.RowDefinitions>
  54. <TextBlock FontSize="14" Foreground="#43474D" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Opacity}"></TextBlock>
  55. <Slider Style="{StaticResource SliderStyle}" Grid.Row="1" Width="148" Height="28"
  56. Name="ImasgeOpacitySlider"
  57. Value="14"
  58. IsSelectionRangeEnabled="True"
  59. IsMoveToPointEnabled="True"
  60. Margin="2,20,2,0"
  61. Maximum="1"
  62. Minimum="0"
  63. TickFrequency="0.01"
  64. IsSnapToTickEnabled="True"
  65. Thumb.DragCompleted="SliderOpacity_DragCompleted"
  66. Thumb.DragStarted="Slider_DragStarted"
  67. ValueChanged="SliderOpacity_ValueChanged"
  68. Tag="true"
  69. />
  70. <Grid Grid.Row="1" Grid.Column="1" Margin="0,10,0,0">
  71. <ComboBox Name="OpacityComboBox" VerticalContentAlignment="Center" Width="72" Height="28" Foreground="#43474D" FontSize="14"
  72. SelectionChanged="OpacityComboBox_SelectionChanged" BorderBrush="#1E000000">
  73. <ComboBoxItem>25%</ComboBoxItem>
  74. <ComboBoxItem>50%</ComboBoxItem>
  75. <ComboBoxItem>75%</ComboBoxItem>
  76. <ComboBoxItem>100%</ComboBoxItem>
  77. </ComboBox>
  78. <TextBox Name="OpacityTextBox" IsHitTestVisible="False" Width="72" Height="30" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
  79. IsReadOnly="True" Background="White" Padding="0,0,15,0" FontSize="14">100%</TextBox>
  80. <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
  81. <Path.Data>
  82. M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
  83. </Path.Data>
  84. </Path>
  85. </Grid>
  86. </Grid>
  87. <Grid Grid.Row="5" Margin="0,20,0,0">
  88. <Grid.RowDefinitions>
  89. <RowDefinition Height="auto"></RowDefinition>
  90. <RowDefinition Height="auto"></RowDefinition>
  91. </Grid.RowDefinitions>
  92. <TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#43474D" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Tool}"></TextBlock>
  93. <Border Grid.Row="1" BorderThickness="1" BorderBrush="#E1E3E5" Margin="0,14,0,0" HorizontalAlignment="Left">
  94. <StackPanel Orientation="Horizontal">
  95. <Button Name="ImageReplaceBtn" Width="40" Height="25" BorderThickness="0" Click="ImageReplaceBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}"
  96. ToolTip="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Menu_Replace}">
  97. <Button.Content>
  98. <Path Fill="#43474D">
  99. <Path.Data>
  100. M1.12988 1.88037H0.379883V2.63037V14.3971V15.1471H1.12988H4.47057V16.2589V17.7589H5.97057H11.9871V16.915L11.9995 16L8.64639
  101. 14.3971L5.97057 15.9838V7.49225H18.0035V12.7161H19.5035V7.49225V5.99225H18.0035H16.9129V2.63037V1.88037H16.1629H1.12988ZM15.4129
  102. 5.99225V3.38037H1.87988V13.6471H4.47057V7.49225V5.99225H5.97057H15.4129ZM14.6574 10.5265C15.2097 10.5265 15.6574 10.0759 15.6574
  103. 9.5201C15.6574 8.9643 15.2097 8.51373 14.6574 8.51373C14.1051 8.51373 13.6574 8.9643 13.6574 9.5201C13.6574 10.0759 14.1051 10.5265
  104. 14.6574 10.5265ZM15.3635 12.4771L14.8863 11.8985L16.0436 10.9442L16.5208 11.5229L17.9828 13.2959L18.9947
  105. 14.5231H17.4042H12.9994H12.2494V13.0231H12.9994H15.8136L15.3635 12.4771ZM15.8007 17.2959L16.2779 17.8746L15.1206 18.8289L14.6434
  106. 18.2502L13.1814 16.4771L12.1695 15.25H13.76H18.1648H18.9148V16.75H18.1648H15.3506L15.8007 17.2959Z
  107. </Path.Data>
  108. </Path>
  109. </Button.Content>
  110. </Button>
  111. <Button Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageExportBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}"
  112. ToolTip="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Menu_Export}">
  113. <Button.Content>
  114. <Path Fill="#43474D">
  115. <Path.Data>
  116. M12.3597 7.35973L8.75 10.9694L8.75 1V0.25H7.25V1L7.25 10.9694L3.6403 7.35973L3.10997 6.8294L2.04931 7.89006L2.57964 8.42039L7.46967
  117. 13.3104C7.76256 13.6033 8.23744 13.6033 8.53033 13.3104L13.4204 8.42039L13.9507 7.89006L12.89 6.8294L12.3597 7.35973ZM1
  118. 15.1538H0.25V16.6538H1H15.3077H16.0577V15.1538H15.3077H1Z
  119. </Path.Data>
  120. </Path>
  121. </Button.Content>
  122. </Button>
  123. <Button Name="ImageClipBtn" Grid.Column="1" Width="40" Height="25" BorderThickness="0" Click="ImageClipBtn_Click" Background="White" Style="{StaticResource LightButtonStyle}"
  124. ToolTip="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Menu_Crop}">
  125. <Button.Content>
  126. <Path Fill="#43474D">
  127. <Path.Data>
  128. M4.75 15.75V4.25H14.4074L13.9517 4.73826L15.0483 5.76174L15.25 5.54562V15.75H4.75ZM3.25
  129. 16.5V4.25H0V2.75H3.25V0.5H4.75V2.75H16H16.75V3.5V15.75H20V17.25H16.75V19.5H15.25V17.25H4H3.25V16.5ZM17.8483 2.76174L18.5483
  130. 2.01174L17.4517 0.988261L16.7517 1.73826L17.8483 2.76174ZM12.2483 8.76174L13.6483 7.26174L12.5517 6.23826L11.1517 7.73826L12.2483
  131. 8.76174ZM9.44829 11.7617L10.8483 10.2617L9.75171 9.23826L8.35171 10.7383L9.44829 11.7617ZM6.64829 14.7617L8.04829 13.2617L6.95171
  132. 12.2383L5.55171 13.7383L6.64829 14.7617Z
  133. </Path.Data>
  134. </Path>
  135. </Button.Content>
  136. </Button>
  137. </StackPanel>
  138. </Border>
  139. </Grid>
  140. </Grid>
  141. </ScrollViewer>
  142. </UserControl>