PixelColorPickerWindow.xaml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <Window
  2. x:Class="GeekDesk.Control.Windows.PixelColorPickerWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xml:lang="zh-CN"
  6. WindowStyle="None"
  7. AllowsTransparency="True"
  8. Background="Black"
  9. PreviewMouseMove="Window_PreviewMouseMove"
  10. MouseLeftButtonDown="Window_MouseLeftButtonDown"
  11. MouseWheel="Window_MouseWheel"
  12. >
  13. <Window.Resources>
  14. <Style x:Key="TextKey" TargetType="TextBlock">
  15. <Setter Property="FontSize" Value="12"/>
  16. </Style>
  17. <Style x:Key="TextValue" TargetType="TextBlock">
  18. <Setter Property="FontSize" Value="12"/>
  19. <Setter Property="Margin" Value="10,0,0,0"/>
  20. </Style>
  21. </Window.Resources>
  22. <Grid>
  23. <Image x:Name="DesktopBG" RenderOptions.BitmapScalingMode="HighQuality"/>
  24. <Canvas HorizontalAlignment="Left" VerticalAlignment="Top" Background="Transparent">
  25. <Canvas x:Name="ColorCanvas"
  26. Width="185"
  27. Height="160">
  28. <Border Background="White"
  29. CornerRadius="5"
  30. >
  31. <Grid>
  32. <WrapPanel HorizontalAlignment="Center" Height="70" Margin="0,5,0,80">
  33. <Border Width="70" Height="70"
  34. BorderBrush="Black"
  35. BorderThickness="1">
  36. <Rectangle x:Name="PixelColor" StrokeThickness="0">
  37. <Rectangle.Fill>
  38. <SolidColorBrush />
  39. </Rectangle.Fill>
  40. </Rectangle>
  41. </Border>
  42. <Border x:Name="Pixel"
  43. HorizontalAlignment="Center"
  44. VerticalAlignment="Center"
  45. Width="70"
  46. Height="70"
  47. Background="Black"
  48. BorderBrush="Black"
  49. BorderThickness="1"
  50. Margin="20,0,0,0"
  51. >
  52. <Grid>
  53. <Rectangle x:Name="PixelBG" StrokeThickness="0">
  54. <Rectangle.Fill>
  55. <VisualBrush ViewboxUnits="Absolute" Viewbox="0,0,20,20"
  56. ViewportUnits="RelativeToBoundingBox" Viewport="0,0,1,1">
  57. </VisualBrush>
  58. </Rectangle.Fill>
  59. </Rectangle>
  60. <Border HorizontalAlignment="Center"
  61. VerticalAlignment="Center"
  62. Width="6" Height="6"
  63. BorderBrush="White" BorderThickness="0.6">
  64. <Border Width="4.5" Height="4.5" BorderBrush="Black" BorderThickness="0.6"/>
  65. </Border>
  66. </Grid>
  67. </Border>
  68. </WrapPanel>
  69. <WrapPanel HorizontalAlignment="Center" Height="80" Margin="0,85,0,5">
  70. <StackPanel Width="100" Height="80">
  71. <TextBlock Text="RGB:" Style="{StaticResource TextKey}"/>
  72. <TextBlock x:Name="PixelColor_RGB" Style="{StaticResource TextValue}"/>
  73. <TextBlock Text="HTML:" Margin="0,5,0,0" Style="{StaticResource TextKey}"/>
  74. <TextBlock x:Name="PixelColor_HTML" Style="{StaticResource TextValue}"/>
  75. </StackPanel>
  76. <StackPanel Width="65" Height="80" Margin="10,0,0,0">
  77. <TextBlock x:Name="Pixel_XY" TextAlignment="Right"/>
  78. </StackPanel>
  79. </WrapPanel>
  80. </Grid>
  81. </Border>
  82. </Canvas>
  83. </Canvas>
  84. </Grid>
  85. </Window>