Picturebox.xaml 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <UserControl x:Class="AIRS.Picturebox"
  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:AIRS"
  7. mc:Ignorable="d"
  8. d:DesignHeight="340" d:DesignWidth="420" Width="420" Height="340" MinHeight="34" MinWidth="42">
  9. <Grid>
  10. <Viewbox Stretch="Fill">
  11. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Width="420" Height="340">
  12. <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="315" VerticalAlignment="Top" Width="420" Background="#FFE0DDDD">
  13. <Canvas x:Name="cantest" Width="420" Height="315" MouseDown="cantest_MouseDown" MouseMove="cantest_MouseMove" MouseUp="cantest_MouseUp" MouseLeave="cantest_MouseLeave" >
  14. <Image x:Name="img" Canvas.Left="0" Canvas.Top="0" Width="420" Height="315">
  15. <Image.RenderTransform>
  16. <TransformGroup>
  17. <ScaleTransform x:Name="sfr" />
  18. <TranslateTransform/>
  19. <ScaleTransform/>
  20. <RotateTransform/>
  21. </TransformGroup>
  22. </Image.RenderTransform>
  23. </Image>
  24. <Path x:Name="field" Fill="#40FF0000" Visibility="Hidden">
  25. <Path.Data>
  26. <GeometryGroup>
  27. <!--Center为圆心的坐标,RadiusX、RadiusY分别为X、Y两轴的半径-->
  28. <RectangleGeometry x:Name="rect" Rect="0,0,420,315"></RectangleGeometry>
  29. <EllipseGeometry x:Name="circle" RadiusX="100" RadiusY="100" Center="210,155"/>
  30. </GeometryGroup>
  31. </Path.Data>
  32. </Path>
  33. <Path x:Name="fieldr" Fill="#40FF0000" Visibility="Hidden">
  34. <Path.Data>
  35. <GeometryGroup>
  36. <!--Center为圆心的坐标,RadiusX、RadiusY分别为X、Y两轴的半径-->
  37. <RectangleGeometry x:Name="rectr" Rect="0,0,420,315"></RectangleGeometry>
  38. <RectangleGeometry x:Name="rectrr" Rect="110,55,100,100"></RectangleGeometry>
  39. </GeometryGroup>
  40. </Path.Data>
  41. </Path>
  42. <!--<Canvas.Background>
  43. <ImageBrush ImageSource="img/test.jpg"/>
  44. </Canvas.Background>-->
  45. </Canvas>
  46. <Canvas Width="420" Height="25" Canvas.Top="315" Background="White">
  47. <Label x:Name="lblpicmsg" Content="1# A58%+B40%+C2%j 100X" Foreground="White" Width="420" Height="25" HorizontalContentAlignment="Center" VerticalContentAlignment="Top" FontSize="12" Background="#FF434E61"></Label>
  48. <Button x:Name="btnanalysis" Content="分析过程" Width="70" Height="17" FontSize="13" Foreground="White" Background="#FF169BD5" Canvas.Left="345" Canvas.Top="4" FontWeight="Bold" Cursor="Hand" MouseMove="btnanalysis_MouseMove" MouseLeave="btnanalysis_MouseLeave">
  49. <Button.Template >
  50. <ControlTemplate TargetType="{x:Type Button}" >
  51. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" CornerRadius="7,7,7,7">
  52. <Border.Background>
  53. <Brush>#FF169BD5</Brush>
  54. </Border.Background>
  55. <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
  56. </Border>
  57. </ControlTemplate>
  58. </Button.Template>
  59. </Button>
  60. </Canvas>
  61. <Border x:Name="box" BorderThickness="2,2,2,2" Width="420" Height="315" Canvas.Left="0" Canvas.Top="0" BorderBrush="#FF169BD5" Visibility="Hidden"/>
  62. </Canvas>
  63. </ScrollViewer>
  64. </Viewbox>
  65. </Grid>
  66. </UserControl>