PixelColorPickerWindow.xaml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. ResizeMode="NoResize"
  10. PreviewMouseMove="Window_PreviewMouseMove"
  11. MouseLeftButtonDown="Window_MouseLeftButtonDown"
  12. MouseRightButtonDown="Window_MouseRightButtonDown"
  13. MouseWheel="Window_MouseWheel"
  14. Loaded="Window_Loaded"
  15. >
  16. <Window.Resources>
  17. <Style x:Key="TextKey" TargetType="TextBlock">
  18. <Setter Property="FontSize" Value="12"/>
  19. </Style>
  20. <Style x:Key="TextValue" TargetType="TextBlock">
  21. <Setter Property="FontSize" Value="12"/>
  22. <Setter Property="Margin" Value="10,0,0,0"/>
  23. </Style>
  24. </Window.Resources>
  25. <Grid>
  26. <Image x:Name="DesktopBG" RenderOptions.BitmapScalingMode="HighQuality"/>
  27. <Canvas HorizontalAlignment="Left" VerticalAlignment="Top" Background="Transparent">
  28. <Canvas x:Name="ColorCanvas"
  29. Width="185"
  30. Height="160">
  31. <Border Background="White"
  32. CornerRadius="5"
  33. >
  34. <Grid>
  35. <WrapPanel HorizontalAlignment="Center" Height="70" Margin="0,5,0,80">
  36. <Border Width="70" Height="70"
  37. BorderBrush="Black"
  38. BorderThickness="1">
  39. <Rectangle x:Name="PixelColor" StrokeThickness="0">
  40. <Rectangle.Fill>
  41. <SolidColorBrush />
  42. </Rectangle.Fill>
  43. </Rectangle>
  44. </Border>
  45. <Border x:Name="Pixel"
  46. HorizontalAlignment="Center"
  47. VerticalAlignment="Center"
  48. Width="70"
  49. Height="70"
  50. Background="Black"
  51. BorderBrush="Black"
  52. BorderThickness="1"
  53. Margin="20,0,0,0"
  54. >
  55. <Grid>
  56. <Rectangle x:Name="PixelBG" StrokeThickness="0">
  57. <Rectangle.Fill>
  58. <VisualBrush ViewboxUnits="Absolute" Viewbox="0,0,20,20"
  59. ViewportUnits="RelativeToBoundingBox" Viewport="0,0,1,1">
  60. </VisualBrush>
  61. </Rectangle.Fill>
  62. </Rectangle>
  63. <Border HorizontalAlignment="Center"
  64. VerticalAlignment="Center"
  65. Width="6" Height="6"
  66. BorderBrush="White" BorderThickness="0.6">
  67. <Border Width="4.5" Height="4.5" BorderBrush="Black" BorderThickness="0.6"/>
  68. </Border>
  69. </Grid>
  70. </Border>
  71. </WrapPanel>
  72. <WrapPanel HorizontalAlignment="Center" Height="80" Margin="0,85,0,5">
  73. <StackPanel Width="100" Height="80">
  74. <TextBlock Text="RGB:" Style="{StaticResource TextKey}"/>
  75. <TextBlock x:Name="PixelColor_RGB" Style="{StaticResource TextValue}"/>
  76. <TextBlock Text="HTML:" Margin="0,5,0,0" Style="{StaticResource TextKey}"/>
  77. <TextBlock x:Name="PixelColor_HTML" Style="{StaticResource TextValue}"/>
  78. </StackPanel>
  79. <StackPanel Width="65" Height="80" Margin="10,0,0,0">
  80. <TextBlock x:Name="Pixel_XY" TextAlignment="Right"/>
  81. </StackPanel>
  82. </WrapPanel>
  83. </Grid>
  84. </Border>
  85. </Canvas>
  86. </Canvas>
  87. </Grid>
  88. </Window>