plcsharp/PLCSharpWpf/Core/UserControls/ImageEdit.xaml

114 lines
5.3 KiB
XML

<UserControl x:Class="PLCSharp.Core.UserControls.ImageEdit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:PLCSharp.Core.UserControls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DataContext="{Binding}"
d:DesignHeight="450" d:DesignWidth="800"
ClipToBounds="True">
<UserControl.Background>
<DrawingBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,20,20" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<SolidColorBrush Color="#ff000000" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,10,10" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<SolidColorBrush Color="#ff222222" />
</GeometryDrawing.Brush>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="10,10,10,10" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<SolidColorBrush Color="#ff222222" />
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</UserControl.Background>
<Grid ClipToBounds="True">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid Panel.ZIndex="0">
<Viewbox>
<Grid Width="{Binding ElementName=img1, Path=ActualWidth}" Height="{Binding ElementName=img1, Path=ActualHeight}">
<Canvas Name="mainBox1"
MouseDown="Img_MouseDown1" MouseLeave="Img_MouseLeave1"
MouseMove="Img_MouseMove1"
MouseRightButtonUp="mainBox1_MouseRightButtonUp"
MouseUp="Img_MouseUp1" MouseWheel="Canvas_MouseWheel">
<Canvas.RenderTransform>
<TransformGroup>
<MatrixTransform x:Name="matrix" />
</TransformGroup>
</Canvas.RenderTransform>
<Image Name="img1" RenderOptions.BitmapScalingMode="NearestNeighbor" />
</Canvas>
</Grid>
</Viewbox>
</Grid>
<Grid Grid.Row="1" Panel.ZIndex="1">
<Border Background="Black" ClipToBounds="True" Opacity="0.5" />
<StackPanel Orientation="Horizontal">
<TextBlock Name="rate"
Margin="5,0,0,0"
Text="100%"
VerticalAlignment="Center"
Foreground="Wheat" />
</StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock Name="mousey"
Margin="5,0,0,0"
Text="0"
VerticalAlignment="Center"
Foreground="Wheat" />
<TextBlock Margin="5,0,0,0" Text=":" VerticalAlignment="Center" Foreground="Wheat" />
<TextBlock Name="mousex"
Margin="5,0,15,0"
Text="0"
VerticalAlignment="Center"
Foreground="Wheat" />
<TextBlock Name="pixelval"
Margin="5,0,15,0"
Text=""
VerticalAlignment="Center"
Foreground="Wheat" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock Name="rows"
Margin="5,0,0,0"
Text="0"
VerticalAlignment="Center"
Foreground="Wheat" />
<TextBlock Margin="5,0,0,0" Text=":" VerticalAlignment="Center" Foreground="Wheat" />
<TextBlock Name="columns"
Margin="5,0,15,0"
Text="0"
VerticalAlignment="Center"
Foreground="Wheat" />
</StackPanel>
</Grid>
</Grid>
</UserControl>