PixelColorPickerWindow.xaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. PreviewMouseMove="Window_PreviewMouseMove"
  9. MouseLeftButtonDown="Window_MouseLeftButtonDown"
  10. MouseWheel="Window_MouseWheel"
  11. >
  12. <Window.Resources>
  13. <Style x:Key="TextKey" TargetType="TextBlock">
  14. <Setter Property="FontSize" Value="12"/>
  15. </Style>
  16. <Style x:Key="TextValue" TargetType="TextBlock">
  17. <Setter Property="FontSize" Value="12"/>
  18. <Setter Property="Margin" Value="10,0,0,0"/>
  19. </Style>
  20. </Window.Resources>
  21. <Grid>
  22. <Grid x:Name="DesktopBG">
  23. <Grid.Background>
  24. <ImageBrush Stretch="Fill"/>
  25. </Grid.Background>
  26. </Grid>
  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. BorderBrush="Black"
  51. BorderThickness="1"
  52. Margin="20,0,0,0"
  53. >
  54. <Grid>
  55. <Rectangle x:Name="PixelBG" StrokeThickness="0">
  56. <Rectangle.Fill>
  57. <VisualBrush ViewboxUnits="Absolute" Viewbox="0,0,20,20"
  58. ViewportUnits="RelativeToBoundingBox" Viewport="0,0,1,1">
  59. </VisualBrush>
  60. </Rectangle.Fill>
  61. </Rectangle>
  62. <Border HorizontalAlignment="Center"
  63. VerticalAlignment="Center"
  64. Width="6" Height="6"
  65. BorderBrush="White" BorderThickness="0.6">
  66. <Border Width="4.5" Height="4.5" BorderBrush="Black" BorderThickness="0.6"/>
  67. </Border>
  68. </Grid>
  69. </Border>
  70. </WrapPanel>
  71. <WrapPanel HorizontalAlignment="Center" Height="80" Margin="0,85,0,5">
  72. <StackPanel Width="100" Height="80">
  73. <TextBlock Text="RGB:" Style="{StaticResource TextKey}"/>
  74. <TextBlock x:Name="PixelColor_RGB" Style="{StaticResource TextValue}"/>
  75. <TextBlock Text="HTML:" Margin="0,5,0,0" Style="{StaticResource TextKey}"/>
  76. <TextBlock x:Name="PixelColor_HTML" Style="{StaticResource TextValue}"/>
  77. </StackPanel>
  78. <StackPanel Width="65" Height="80" Margin="10,0,0,0">
  79. <TextBlock x:Name="Pixel_XY" TextAlignment="Right"/>
  80. </StackPanel>
  81. </WrapPanel>
  82. </Grid>
  83. </Border>
  84. </Canvas>
  85. </Canvas>
  86. </Grid>
  87. </Window>