ImageEditProperty.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <UserControl
  2. x:Class="PDF_Master.Views.PropertyPanel.PDFEdit.ImageEditProperty"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:CompositeControl="clr-namespace:PDF_Master.CustomControl.CompositeControl"
  6. xmlns:Convert="clr-namespace:PDF_Master.DataConvert"
  7. xmlns:FormControl="clr-namespace:PDF_Master.CustomControl.Form"
  8. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  9. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  10. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.PDFEdit"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DesignHeight="600"
  15. d:DesignWidth="260"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. mc:Ignorable="d">
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
  22. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
  23. <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
  24. </ResourceDictionary.MergedDictionaries>
  25. <Convert:BoolToVisible x:Key="BoolToVisible" />
  26. <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  27. <Convert:InvertBoolConvert x:Key="InvertBoolConvert" />
  28. </ResourceDictionary>
  29. </UserControl.Resources>
  30. <Grid Background="{StaticResource color.sys.layout.mg}">
  31. <StackPanel Margin="16,14">
  32. <TextBlock
  33. Name="AnnotTypeTitle1"
  34. HorizontalAlignment="Left"
  35. FontFamily="Segoe UI"
  36. FontSize="14"
  37. FontWeight="SemiBold"
  38. LineHeight="24">
  39. Edit Image
  40. </TextBlock>
  41. <Border
  42. Width="228"
  43. Height="88"
  44. Margin="0,8,0,0"
  45. Background="{StaticResource color.field.bg.def}"
  46. BorderBrush="{StaticResource color.field.border.norm}"
  47. BorderThickness="1"
  48. CornerRadius="2"
  49. Visibility="{Binding IsMultiSelectImage, Converter={StaticResource InvertBoolToVisibleConvert}}">
  50. <Grid>
  51. <Border
  52. Name="FreeTextBorder1"
  53. Padding="5"
  54. HorizontalAlignment="Center"
  55. VerticalAlignment="Center"
  56. Opacity="{Binding OpacityUI, Mode=OneWay}">
  57. <Image x:Name="ImgExmple" Source="{Binding CurrentImg}" />
  58. </Border>
  59. </Grid>
  60. </Border>
  61. <StackPanel
  62. Margin="0,8,0,0"
  63. HorizontalAlignment="Center"
  64. Orientation="Horizontal">
  65. <Button
  66. Width="32"
  67. Height="32"
  68. Margin="0,0,8,0"
  69. Command="{Binding AntiClockwiseCommand}"
  70. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  71. Style="{StaticResource subToolBar}">
  72. <Path Data="M11.9784 2.52529C8.94121 0.771787 5.05761 1.81239 3.30411 4.84955C3.00688 5.36436 2.78981 5.90407 2.64922 6.45385L2.1804 4.70416L0.731506 5.09239L1.68396 8.647C1.79117 9.0471 2.20242 9.28453 2.60252 9.17733L6.15713 8.22487L5.7689 6.77598L4.01473 7.24601C4.10628 6.68216 4.2999 6.1248 4.60315 5.59955C5.94244 3.27983 8.90865 2.48504 11.2284 3.82433C13.5481 5.16362 14.3429 8.12983 13.0036 10.4496C11.6643 12.7693 8.69809 13.5641 6.37837 12.2248L5.62837 13.5238C8.66553 15.2773 12.5491 14.2367 14.3026 11.1996C16.0561 8.16239 15.0155 4.2788 11.9784 2.52529Z" Fill="{StaticResource color.icon.base.brand}" />
  73. </Button>
  74. <Button
  75. Width="32"
  76. Height="32"
  77. Command="{Binding ClockwiseCommand}"
  78. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  79. Style="{StaticResource subToolBar}">
  80. <Path Data="M11.9922 7.24898C11.6312 4.92704 9.62312 3.15002 7.19998 3.15002C4.52139 3.15002 2.34998 5.32144 2.34998 8.00002C2.34998 10.6786 4.52139 12.85 7.19998 12.85C8.08462 12.85 8.91183 12.6139 9.62443 12.2016L10.3755 13.5C9.44076 14.0408 8.35534 14.35 7.19998 14.35C3.69297 14.35 0.849976 11.507 0.849976 8.00002C0.849976 4.49302 3.69297 1.65002 7.19998 1.65002C10.1642 1.65002 12.6541 3.68116 13.3538 6.42761L13.8156 4.7042L15.2645 5.09243L14.312 8.64704C14.2048 9.04714 13.7935 9.28457 13.3934 9.17737L9.83884 8.22491L10.2271 6.77602L11.9922 7.24898Z" Fill="{StaticResource color.icon.base.brand}" />
  81. </Button>
  82. <Button
  83. Width="32"
  84. Height="32"
  85. Margin="4,0,0,0"
  86. Command="{Binding FlipleftrightCommand}"
  87. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  88. Style="{StaticResource subToolBar}">
  89. <Path Data="M8.66647 12.6667V14H7.33313V12.6667H8.66647ZM2.66643 2.78133C2.77373 2.78129 2.87946 2.80714 2.97464 2.8567C3.06981 2.90626 3.15161 2.97806 3.2131 3.066L6.39912 7.618C6.47742 7.73 6.51942 7.86335 6.51942 8C6.51942 8.13665 6.47742 8.27001 6.39912 8.382L3.21243 12.934C3.13111 13.0501 3.01492 13.1372 2.88072 13.1828C2.74652 13.2283 2.6013 13.2299 2.46612 13.1873C2.33095 13.1448 2.21286 13.0602 2.129 12.946C2.04514 12.8317 1.99987 12.6937 1.99976 12.552V3.448C1.99976 3.27119 2.06999 3.10162 2.19502 2.9766C2.32004 2.85157 2.48962 2.78133 2.66643 2.78133ZM13.3332 2.78133C13.4966 2.78137 13.6543 2.84142 13.7763 2.95006C13.8983 3.0587 13.9762 3.20838 13.9952 3.37067L13.9998 3.448V12.552C13.9996 12.6865 13.9588 12.8177 13.8826 12.9286C13.8064 13.0394 13.6985 13.1246 13.573 13.1729C13.4476 13.2213 13.3104 13.2306 13.1796 13.1997C13.0487 13.1687 12.9303 13.0988 12.8398 12.9993L12.7865 12.934L9.60048 8.382C9.53113 8.28282 9.49008 8.16663 9.48174 8.0459C9.4734 7.92517 9.49809 7.80444 9.55314 7.69667L9.60048 7.618L12.7872 3.066C12.8486 2.97815 12.9303 2.90641 13.0253 2.85685C13.1204 2.8073 13.226 2.78139 13.3332 2.78133ZM8.66647 10V11.3333H7.33313V10H8.66647ZM3.06643 4.986V11.2L5.24911 8L3.0671 4.986H3.06643ZM8.66647 7.33333V8.66667H7.33313V7.33333H8.66647ZM8.66647 4.66667V6H7.33313V4.66667H8.66647ZM8.66647 2V3.33333H7.33313V2H8.66647Z" Fill="{StaticResource color.icon.base.brand}" />
  90. </Button>
  91. <Button
  92. Width="32"
  93. Height="32"
  94. Margin="6,0,0,0"
  95. Command="{Binding UpsidedownCommand}"
  96. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  97. Style="{StaticResource subToolBar}">
  98. <Path Data="M3.33383 8.66667H2.00049V7.33333H3.33383V8.66667ZM13.2192 2.66667C13.2193 2.77397 13.1934 2.8797 13.1439 2.97487C13.0943 3.07004 13.0225 3.15185 12.9346 3.21333L8.38253 6.39933C8.27054 6.47764 8.13719 6.51963 8.00053 6.51963C7.86388 6.51963 7.73052 6.47764 7.61853 6.39933L3.0665 3.21267C2.95043 3.13135 2.86329 3.01516 2.81774 2.88096C2.77218 2.74676 2.77058 2.60154 2.81316 2.46636C2.85574 2.33119 2.94029 2.21311 3.05453 2.12925C3.16878 2.04538 3.30678 2.00011 3.4485 2H12.5526C12.7294 2 12.8989 2.07024 13.024 2.19526C13.149 2.32029 13.2192 2.48986 13.2192 2.66667ZM13.2192 13.3333C13.2192 13.4967 13.1592 13.6544 13.0505 13.7765C12.9419 13.8985 12.7922 13.9764 12.6299 13.9953L12.5526 14H3.4485C3.31403 13.9998 3.18276 13.9589 3.07194 13.8827C2.96113 13.8066 2.87593 13.6987 2.82755 13.5732C2.77916 13.4477 2.76985 13.3106 2.80084 13.1797C2.83182 13.0489 2.90165 12.9304 3.00116 12.84L3.0665 12.7867L7.61853 9.60067C7.71771 9.53132 7.8339 9.49027 7.95463 9.48193C8.07537 9.47359 8.19609 9.49827 8.30387 9.55333L8.38253 9.60067L12.9346 12.7873C13.0224 12.8488 13.0942 12.9305 13.1437 13.0255C13.1933 13.1205 13.2192 13.2261 13.2192 13.3333ZM6.00052 8.66667H4.66717V7.33333H6.00052V8.66667ZM11.0146 3.06667H4.80051L8.00053 5.24933L11.0146 3.068V3.06667ZM8.6672 8.66667H7.33386V7.33333H8.6672V8.66667ZM11.3339 8.66667H10.0005V7.33333H11.3339V8.66667ZM14.0006 8.66667H12.6672V7.33333H14.0006V8.66667Z" Fill="{StaticResource color.icon.base.brand}" />
  99. </Button>
  100. </StackPanel>
  101. <CompositeControl:SlidComboControl
  102. x:Name="slid"
  103. Title="{Binding Opacity, Mode=TwoWay}"
  104. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  105. SelectedIndex="{Binding OpacitySelectedIndex, Mode=TwoWay}"
  106. Unit="%"
  107. Value="{Binding Transpent, Mode=TwoWay}">
  108. <i:Interaction.Triggers>
  109. <i:EventTrigger EventName="PreviewMouseLeftButtonUp">
  110. <i:InvokeCommandAction Command="{Binding TranspentslidCommand}" PassEventArgsToCommand="True" />
  111. </i:EventTrigger>
  112. </i:Interaction.Triggers>
  113. </CompositeControl:SlidComboControl>
  114. <StackPanel
  115. Width="228"
  116. Margin="0,16,0,0"
  117. HorizontalAlignment="Center">
  118. <Grid x:Name="GridCrop" Visibility="{Binding IsMultiSelectImage, Converter={StaticResource InvertBoolToVisibleConvert}}">
  119. <Button
  120. x:Name="BtnCrop"
  121. Height="32"
  122. BorderBrush="#DFE1E5"
  123. BorderThickness="1"
  124. Command="{Binding CropModeCommand}"
  125. Content="Crop"
  126. ContentStringFormat="156"
  127. Focusable="False"
  128. FontSize="14"
  129. Foreground="Black"
  130. Style="{StaticResource btn.sec}"
  131. Tag="Crop"
  132. Visibility="{Binding IsCrop, Converter={StaticResource InvertBoolToVisibleConvert}}" />
  133. <Grid Visibility="{Binding IsCrop, Converter={StaticResource BoolToVisible}}">
  134. <Grid.ColumnDefinitions>
  135. <ColumnDefinition Width="*" />
  136. <ColumnDefinition Width="8" />
  137. <ColumnDefinition Width="*" />
  138. </Grid.ColumnDefinitions>
  139. <Button
  140. Height="32"
  141. Command="{Binding CropImgCommand}"
  142. Content="Crop"
  143. Focusable="False"
  144. FontSize="14"
  145. Style="{StaticResource Btn.cta}" />
  146. <Button
  147. Grid.Column="2"
  148. Background="White"
  149. BorderBrush="#DFE1E5"
  150. BorderThickness="1"
  151. Command="{Binding CancelCropCommand}"
  152. Content="Cancel"
  153. Focusable="False"
  154. FontSize="14"
  155. Style="{StaticResource btn.sec}" />
  156. </Grid>
  157. </Grid>
  158. <Button
  159. x:Name="BtnReplace"
  160. Height="32"
  161. Margin="0,8"
  162. VerticalAlignment="Center"
  163. BorderBrush="#DFE1E5"
  164. BorderThickness="1"
  165. Command="{Binding ReplaceImgCommand}"
  166. Content="Replace"
  167. FontSize="14"
  168. Foreground="Black"
  169. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  170. Style="{StaticResource btn.sec}"
  171. Tag="Replace"
  172. Visibility="{Binding IsMultiSelectImage, Converter={StaticResource InvertBoolToVisibleConvert}}" />
  173. <Button
  174. x:Name="BtnExtract"
  175. Height="32"
  176. BorderBrush="#DFE1E5"
  177. BorderThickness="1"
  178. Command="{Binding ExportImgCommand}"
  179. ContentStringFormat="156"
  180. FontSize="14"
  181. Foreground="Black"
  182. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  183. Style="{StaticResource btn.sec}"
  184. Tag="Extract">
  185. <TextBlock Text="Export" />
  186. </Button>
  187. </StackPanel>
  188. <TextBlock
  189. x:Name="AlignImg"
  190. Margin="0,18,0,10"
  191. FontFamily="Segoe UI"
  192. FontSize="12"
  193. FontWeight="SemiBold"
  194. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  195. LineHeight="20"
  196. Visibility="Collapsed">
  197. Align
  198. </TextBlock>
  199. <FormControl:LayoutAglinContent
  200. x:Name="laoutAglin"
  201. IsLayoutAlign="{Binding IsLayoutAlign}"
  202. IsLayoutAvgAlign="{Binding IsLayoutAvgAlign}"
  203. Visibility="Collapsed">
  204. <i:Interaction.Triggers>
  205. <i:EventTrigger EventName="ValueChanged">
  206. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=laoutAglin, Path=Btntag}" />
  207. </i:EventTrigger>
  208. </i:Interaction.Triggers>
  209. </FormControl:LayoutAglinContent>
  210. </StackPanel>
  211. </Grid>
  212. </UserControl>