Commit 6b9432ff by 鲁志-悦动

拉16:9裁切框

parent 9b559226
...@@ -72,4 +72,6 @@ ...@@ -72,4 +72,6 @@
<sys:String x:Key="AbandonHotkey">Abandon</sys:String> <sys:String x:Key="AbandonHotkey">Abandon</sys:String>
<sys:String x:Key="Delete">DeleteMark</sys:String> <sys:String x:Key="Delete">DeleteMark</sys:String>
<sys:String x:Key="DefaultHotkey">RestoreDefault</sys:String> <sys:String x:Key="DefaultHotkey">RestoreDefault</sys:String>
<sys:String x:Key="CutZone">CutZone</sys:String>
<sys:String x:Key="PullBox">PullBox</sys:String>
</ResourceDictionary> </ResourceDictionary>
...@@ -71,4 +71,6 @@ ...@@ -71,4 +71,6 @@
<sys:String x:Key="AbandonHotkey">二次确认(抛弃)</sys:String> <sys:String x:Key="AbandonHotkey">二次确认(抛弃)</sys:String>
<sys:String x:Key="Delete">删除标记</sys:String> <sys:String x:Key="Delete">删除标记</sys:String>
<sys:String x:Key="DefaultHotkey">恢复默认</sys:String> <sys:String x:Key="DefaultHotkey">恢复默认</sys:String>
<sys:String x:Key="CutZone">裁切区域</sys:String>
<sys:String x:Key="PullBox">拖框</sys:String>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
...@@ -1136,14 +1136,14 @@ ...@@ -1136,14 +1136,14 @@
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="14" FontSize="14"
Foreground="White" Foreground="White"
Text="裁切区域" /> Text="{DynamicResource CutZone}" />
<ToggleButton <ToggleButton
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Height="40" Height="40"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Command="{Binding Path=SelectedCommand}" Command="{Binding Path=SelectedCommand}"
Content="拖框" Content="{DynamicResource PullBox}"
IsChecked="{Binding SelectedIsChecked, Mode=TwoWay}" IsChecked="{Binding SelectedIsChecked, Mode=TwoWay}"
Style="{StaticResource ToggleButtonStyle}" /> Style="{StaticResource ToggleButtonStyle}" />
<Button <Button
......
...@@ -217,6 +217,7 @@ namespace VIZ.FGOUT.Module ...@@ -217,6 +217,7 @@ namespace VIZ.FGOUT.Module
this.Moving_pixelKeyDownCommand = new VCommand<KeyEventArgs>(this.Moving_pixelKeyDown); this.Moving_pixelKeyDownCommand = new VCommand<KeyEventArgs>(this.Moving_pixelKeyDown);
this.Remove_out_point_pixelKeyDownCommand = new VCommand<KeyEventArgs>(Remove_out_point_pixelKeyDown); this.Remove_out_point_pixelKeyDownCommand = new VCommand<KeyEventArgs>(Remove_out_point_pixelKeyDown);
//保留最高点和大模型
this.KeepHighestCommand = new VCommand(this.KeepHighest); this.KeepHighestCommand = new VCommand(this.KeepHighest);
this.BigModelCommand = new VCommand(this.BigModel); this.BigModelCommand = new VCommand(this.BigModel);
......
...@@ -360,6 +360,16 @@ namespace VIZ.FGOUT.Module ...@@ -360,6 +360,16 @@ namespace VIZ.FGOUT.Module
} }
canvas1.Children.Remove(tempPath); canvas1.Children.Remove(tempPath);
//16:9
rectSelected.Height = rectSelected.Width * 9 / 16;
//高度出画面的情况
if (rectSelected.TopLeft.Y + rectSelected.Height > this.video.Height)
{
//先算出高,再反算出宽
rectSelected.Height = this.video.Height - rectSelected.TopLeft.Y - 6;
rectSelected.Width = rectSelected.Height * 16 / 9;
}
//rectSelected.Width = rectSelected.Height * 16 / 9;
aa = new PathGeometry(); aa = new PathGeometry();
aa.AddGeometry(new RectangleGeometry(rectSelected)); aa.AddGeometry(new RectangleGeometry(rectSelected));
var myPath = new Path() var myPath = new Path()
......
...@@ -226,7 +226,7 @@ namespace VIZ.FGOUT.Module ...@@ -226,7 +226,7 @@ namespace VIZ.FGOUT.Module
NDIView nDIView = this.GetView<NDIView>(); NDIView nDIView = this.GetView<NDIView>();
var rect = nDIView.rectSelected; var rect = nDIView.rectSelected;
if (rect != null && rect.Width > 0) if (rect.Width > 0)
{ {
// 发送UDP命令给音视频 // 发送UDP命令给音视频
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP); UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
...@@ -250,6 +250,7 @@ namespace VIZ.FGOUT.Module ...@@ -250,6 +250,7 @@ namespace VIZ.FGOUT.Module
//if (this.ViewKey == NDIViewKeys.CAM_2 || this.ViewKey == NDIViewKeys.CAM_4) return; //if (this.ViewKey == NDIViewKeys.CAM_2 || this.ViewKey == NDIViewKeys.CAM_4) return;
if (this.ViewKey != NDIViewKeys.CAM_1) return; if (this.ViewKey != NDIViewKeys.CAM_1) return;
IsSelected = selectedModel.IsSelected; IsSelected = selectedModel.IsSelected;
//没有选中的时候,清除框
if (!IsSelected) if (!IsSelected)
{ {
NDIView nDIView = this.GetView<NDIView>(); NDIView nDIView = this.GetView<NDIView>();
...@@ -1216,8 +1217,10 @@ namespace VIZ.FGOUT.Module ...@@ -1216,8 +1217,10 @@ namespace VIZ.FGOUT.Module
int dx = Convert.ToInt32(rect.X / xp); int dx = Convert.ToInt32(rect.X / xp);
int dy = Convert.ToInt32(rect.Y / xy); int dy = Convert.ToInt32(rect.Y / xy);
int width = Convert.ToInt32(rect.Width / xp); int width = Convert.ToInt32(rect.Width / xp);
//int height2 = Convert.ToInt32(rect.Height / xy);
int height = Convert.ToInt32(width * 9 / 16);
return new CutPackage() { point = new Point(dx, dy), width = width, height = Convert.ToInt32(width * 9 / 16) }; return new CutPackage() { point = new Point(dx, dy), width = width, height = height };
} }
private List<List<List<int>>> CoordinateTrackingBoxInfo(RawRectangleF rect, double srcWidth, double srcHeight) private List<List<List<int>>> CoordinateTrackingBoxInfo(RawRectangleF rect, double srcWidth, double srcHeight)
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DB3E8891C6259C7E7B14BEEC7B2210E24DEC5152955F643723E8CFFFEC460892" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "72019AA88A2EFE0C59DFBF453A7E27C8FD19969111F82637DAEAAD62684F11D5"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DB3E8891C6259C7E7B14BEEC7B2210E24DEC5152955F643723E8CFFFEC460892" #pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "72019AA88A2EFE0C59DFBF453A7E27C8FD19969111F82637DAEAAD62684F11D5"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
...@@ -55,5 +55,5 @@ using System.Windows; ...@@ -55,5 +55,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.15.0")] [assembly: AssemblyVersion("1.0.16.0")]
[assembly: AssemblyFileVersion("1.0.15.0")] [assembly: AssemblyFileVersion("1.0.16.0")]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment