Blend for Visual Studio 2012 能支持framewrk4.5.2的框架吗 2C

Blend for Visual Studio 2012 能支持framewrk4.5.2的框架吗?
目前只支持4.5框架~我项目是4.5.2框架的在Blend中编辑的时候不出现窗口设计器界面。有没有大牛们遇到过~怎么破

1个回答

可以,4.5.2向下兼容4.5

lihengupdate
lihengupdate 现在是Blend for Visual Studio 2012支持到4.5 不向上兼容到4.5.2
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
visual studio 和 blend for visual studio 有什么区别?
我看到与visual studio一起安装的有blend for visual studio, 不知道它们有什么区别?哪一个好用?
关于livecharts官网中提供的Features->Events的示例问题?
livecharts示例代码:https://lvcharts.net/App/examples/v1/wpf/Events 我应用于wpf项目中的代码: ScrollableViewModel.cs ``` using LiveCharts; using LiveCharts.Defaults; using LiveCharts.Geared; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; namespace WpfApp1.Resources.UserControls.Scrollable { public class ScrollableViewModel : INotifyPropertyChanged { private Func<double, string> _formatter; private Func<double, string> _xformatter; private double _from; private double _to; private double _min; private double _max; public ScrollableViewModel() { DataClickCommand = new MyCommand<ChartPoint> { ExecuteDelegate = p => From = Values.FirstOrDefault().DateTime.Ticks }; var now = DateTime.Now; var trend = -30000d; var l = new List<DateTimePoint>(); var Eventl = new List<VisitsByDateTime>(); var r = new Random(); for (var i = 0; i < 50000; i++) { now = now.AddMilliseconds(100); double xx = Convert.ToDateTime(now).ToOADate(); //每隔100毫秒 l.Add(new DateTimePoint(now, trend)); //每隔一分鐘造一個事件 if (i % 600 == 0) Eventl.Add(new VisitsByDateTime { DateTime = now, Total = (decimal)1 }); if (r.NextDouble() > 0.4) { trend += r.NextDouble() * 10; } else { trend -= r.NextDouble() * 10; } } Formatter = x => new DateTime((long)x).ToString("dd日HH时mm分ss秒fff毫秒"); XFormatter = x => new DateTime((long)x).ToString("dd日HH时mm分"); Values = l.AsGearedValues().WithQuality(Quality.High); EventValues = Eventl.AsGearedValues(); From = DateTime.Now.AddMilliseconds(10000).Ticks; To = DateTime.Now.AddMilliseconds(900000).Ticks; Min = Values.FirstOrDefault().DateTime.Ticks; Max = Values.LastOrDefault().DateTime.Ticks; } public MyCommand<ChartPoint> DataClickCommand { get; set; } public object Mapper { get; set; } //波形 public GearedValues<DateTimePoint> Values { get; set; } //事件 public GearedValues<VisitsByDateTime> EventValues { get; set; } public double From { get { return _from; } set { _from = value; OnPropertyChanged("From"); } } public double To { get { return _to; } set { _to = value; OnPropertyChanged("To"); } } public double Min { get { return _min; } set { _min = value; OnPropertyChanged("Min"); } } public double Max { get { return _max; } set { _max = value; OnPropertyChanged("Max"); } } public Func<double, string> Formatter { get { return _formatter; } set { _formatter = value; OnPropertyChanged("Formatter"); } } public Func<double, string> XFormatter { get { return _xformatter; } set { _xformatter = value; OnPropertyChanged("XFormatter"); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName = null) { if (PropertyChanged != null) PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } public class MyCommand<T> : ICommand where T : class { public Predicate<T> CanExecuteDelegate { get; set; } public Action<T> ExecuteDelegate { get; set; } public bool CanExecute(object parameter) { return CanExecuteDelegate == null || CanExecuteDelegate((T)parameter); } public void Execute(object parameter) { if (ExecuteDelegate != null) ExecuteDelegate((T)parameter); } public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } } } ``` ScrollableViewE.xaml ``` <UserControl x:Class="WpfApp1.Resources.UserControls.ScrollableE.ScrollableViewE" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WpfApp1.Resources.UserControls.ScrollableE" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:geared="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared" xmlns:scrollable="clr-namespace:WpfApp1.Resources.UserControls.Scrollable" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> <UserControl.DataContext> <scrollable:ScrollableViewModel></scrollable:ScrollableViewModel> </UserControl.DataContext> <Grid> <lvc:CartesianChart Name="ScrollChart" DisableAnimations="True" ClipToBounds="True" Zoom="X" DataClick="ChartOnDataClick" Margin="20 10"> <lvc:CartesianChart.Resources> <Style TargetType="lvc:Separator"> <Setter Property="IsEnabled" Value="False"></Setter> </Style> </lvc:CartesianChart.Resources> <lvc:CartesianChart.Series> <geared:GColumnSeries Values="{Binding EventValues}" StrokeThickness="3"/> <geared:GLineSeries Values="{Binding Values}" LineSmoothness="0" StrokeThickness="2" Stroke="#00e701" PointGeometry="{x:Null}" AreaLimit="0"/> </lvc:CartesianChart.Series> <lvc:CartesianChart.AxisX> <lvc:Axis IsMerged="True" LabelFormatter="{Binding XFormatter, Mode=OneTime}" MinValue="{Binding Min, Mode=TwoWay}" MaxValue="{Binding Max, Mode=TwoWay}" Foreground="#fff" FontSize="12" FontWeight="UltraBold"/> </lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisY> <lvc:Axis ShowLabels="False" /> </lvc:CartesianChart.AxisY> </lvc:CartesianChart> </Grid> </UserControl> ``` ScrollableViewE.cs ``` using LiveCharts; using LiveCharts.Wpf; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfApp1.Resources.UserControls.ScrollableE { /// <summary> /// ScrollableViewE.xaml 的交互逻辑 /// </summary> public partial class ScrollableViewE : UserControl { public ScrollableViewE() { InitializeComponent(); } private void ChartOnDataClick(object sender, ChartPoint p) { Console.WriteLine("[EVENT] You clicked (" + p.X + ", " + p.Y + ")"); } } } ``` 运行截图: ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579513236_276210.png) 问题:当我点击折线图的时候可以进入到ChartOnDataClick方法,但是为什么点击柱状图的时候没反应呢?怎么才能让点击柱状图的时候进入到ChartOnDataClick方法?
vs2010和vs2013安装完之后,闪退。
今天下载完安装之后,都可以正常打开,安装了大番茄插件之后,出现欢迎界面 ![图片说明](https://img-ask.csdn.net/upload/201506/17/1434552871_744847.png) ![图片说明](https://img-ask.csdn.net/upload/201506/17/1434552907_520997.png) 直接闪退,无反应。 打开Blend for Visual Studio 2013则没有问题
关于C#自定义WPF窗口最小化后点开界面闪烁问题?
我自定义了一个WPF窗口,头部代码是这样的 ``` <Window x:Class="Aurora.RichTextWindow" 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Aurora" mc:Ignorable="d" Title="Aurora" WindowStyle="None" MinWidth="600" MinHeight="500" Width="600" Height="500" WindowStartupLocation="CenterScreen" ResizeMode="CanResizeWithGrip" Loaded="Window_Loaded" SizeChanged="Window_SizeChanged"> ``` 在这个页面自定义了几个按钮,以实现,最小化、还原、最大化等功能,实现该功能通过改变窗口的windowState,比如 ``` private void btnMinimize_Click(object sender, RoutedEventArgs e) { this.WindowState = WindowState.Minimized; } private void btnMaximize_Click(object sender, RoutedEventArgs e) { this.WindowState = WindowState.Maximized; btnRestore.Visibility = Visibility.Visible; btnMaximize.Visibility = Visibility.Collapsed; } private void btnRestore_Click(object sender, RoutedEventArgs e) { this.WindowState = WindowState.Normal; btnRestore.Visibility = Visibility.Collapsed; btnMaximize.Visibility = Visibility.Visible; } ``` 问题是,当最小化后恢复时,界面出现黑白闪烁,类似这样: ![图片说明](https://img-ask.csdn.net/upload/202002/06/1580968008_800308.jpg) 这个闪烁一闪而过,最后还是会呈现正确的界面 请问有大神知道如何避免出现这种闪烁吗?谢谢。
Blend2019能不能导入AI文件
Blend2019能不能导入AI文件作出复合路径 或者怎么用blend做出Ai文件里的复杂的集合路径
VS2019未到return就突然函数执行结束
![图片说明](https://img-ask.csdn.net/upload/201912/28/1577510261_313085.png) 构造函数执行到第47行就返回了,断点检测到的,程序没有爆出任何异常。 之前代码都一直是正常执行的,突然一次编译就这样了 而且突然所有的数据绑定和命令绑定都失效了。 有谁遇见过吗? ``` <Page xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="VRnew.View.ManagePatientView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VRnew.View" mc:Ignorable="d" DataContext="{Binding managePatientViewModel, Source={StaticResource Locator}}" x:Name="ManagePatientVMPage" Title="ManagePatientView"> <telerik:RadButton x:Name="FlushButton" Grid.Row="4" Grid.Column="0" Content="刷新" FontSize="25" Command="{Binding DataContext.FlushPatient ,ElementName=ManagePatientVMPage}" telerik:StyleManager.Theme="Office2016Touch" ></telerik:RadButton> ``` 这是View层的 ``` private RelayCommand _flushpatient; public RelayCommand FlushPatient => _flushpatient ?? (_flushpatient = new RelayCommand (async () => { PatientInformationIE = managePatientModel.GetAllPatient(); }) ); ``` 这是VM层的,点击flush按钮没有触发command,断点不执行这里。
WPF .Net FameWork4.6.1 DataGrid 数据要点击才显示
DataGrid 数据要点击才显示然后 点击其他地方又隐藏了 是照着微软例子写的:https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application 我的项目源代码: 链接:https://pan.baidu.com/s/1EAu-NoczTAPpOdTadHQR_Q 提取码:fntw 如图:数据有的,就是不显示: ![图片说明](https://img-ask.csdn.net/upload/201903/19/1552975802_492289.jpg) ![图片说明](https://img-ask.csdn.net/upload/201903/19/1552975793_320016.jpg) DataGrid 代码: ![图片说明](https://img-ask.csdn.net/upload/201903/19/1552975739_313108.jpg) 整个文件: ``` <Page x:Class="ExpenseIt.ExpenseReportPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:ExpenseIt" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Title="ExpenseIt - View Expense"> <Grid> <Grid.Background> <ImageBrush ImageSource="watermark.png"/> </Grid.Background> <Grid.ColumnDefinitions> <ColumnDefinition Width="230"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions> <Label Grid.Column="1" Style="{StaticResource headerTextStyle}"> Expen Report For: </Label> <Grid Margin="10" Grid.Column="1" Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition /> </Grid.RowDefinitions> <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Orientation="Horizontal" > <Label Style="{StaticResource labelStyle}">Name:</Label> <Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Name}"></Label> </StackPanel> <!-- DepartMent --> <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Orientation="Horizontal"> <Label Style="{StaticResource labelStyle}">DeparTment</Label> <Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Department}"></Label> </StackPanel> <Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" VerticalAlignment="Top" HorizontalAlignment="Left"> <!--Templates to Diaplay Expense Report data--> <Grid.Resources> <!--Reason item Template--> <DataTemplate x:Key="typeItemTemplate"> <Label Content="{Binding XPath=@ExpenseType}"/> </DataTemplate> <!--Amount item template--> <DataTemplate x:Key="amountItemTemplate"> <Label Content="{Binding XPath=@ExpenseAmount}"/> </DataTemplate> </Grid.Resources> <!-- Expense Type and Amount table --> <DataGrid ItemsSource="{Binding XPath=Expense}" ColumnHeaderStyle="{StaticResource columnHeaderSyle}" AutoGenerateColumns="False" RowHeaderWidth="0" RowHeight="50"> <DataGrid.Columns> <DataGridTemplateColumn Header="ExpenseType" CellEditingTemplate="{StaticResource typeItemTemplate}"/> <DataGridTemplateColumn Header="Amount" CellEditingTemplate="{StaticResource amountItemTemplate}"/> </DataGrid.Columns> </DataGrid> </Grid> </Grid> </Grid> </Page> ```
请问这个问题怎么解决?WPF自定义控件。重写Tetxbox的控件模板。
我自定义了一个控件。是Textbox的控件。我重写了ControlTemplate, 里面有一个TextBox和Image,然后弹出会有一弹出框。但是选择选项之后, 值显示不出来。![图片说明](https://img-ask.csdn.net/upload/201912/01/1575212140_881848.png)选了之后的Tetxbox显示是空的,但是实际上值是有的。 请问这种怎么显示出来。 附上代码:XAML: <TextBox x:Class="WPFdemo.公共控件.TextList" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WPFdemo.公共控件" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" Height="30"> <TextBox.Template> <ControlTemplate> <Border CornerRadius="3" BorderBrush="LightSkyBlue" BorderThickness="2"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="25"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBox Grid.Column="0" BorderThickness="0"></TextBox> <Image Grid.Column="1" Source="F:\视频和代码\Code\WPFDEMO\WPFdemo\Image\book.png"></Image> </Grid> </Border> </ControlTemplate> </TextBox.Template> </TextBox> 后台代码: 这里是双击赋值的代码 private void GridView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { this.Cursor = Cursors.Wait; DataRow dataRow = gridView.SelectedItem as DataRow; this.Text = this.GetSelectedText = dataRow[DisplayMember].ToString(); this.GetSelectedValue = dataRow[ValueMember].ToString(); popContainer.IsOpen = false; this.Cursor = Cursors.Arrow; // MessageBox.Show(this.Text); } catch (Exception ex) { MessageBox.Show(ex.Message, "错误信息", MessageBoxButton.YesNo, MessageBoxImage.Error); } }
WPF的Webbrowser浏览本地html中的echart图,鼠标悬浮不出数据。
公司WPF项目要看各种折线统计图,然后我用webbroswer打开本地html交互做好了,但是鼠标悬浮在图上到交点的时候不会显示点的数据,我又做了个小demo,单独拉了一个wpf项目这么做是成功的,鼠标悬浮以后是出点数据的,但是公司的项目就是不行,可惜我不是很精通wpf,总感觉鼠标下有一层这招挡着,导致根本没法触发鼠标的各种事件,求解决。 这个是Echart.xaml那个子页面 ``` <Page x:Class="HontyeNMR.UserControls.Echart" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:HontyeNMR.UserControls" mc:Ignorable="d" d:DesignHeight="375" d:DesignWidth="1000"> <Grid> <WebBrowser x:Name="webBrowser1"/> </Grid> </Page> ``` 后台只有一句 webBrowser1.Navigate("https://echarts.baidu.com/examples/editor.html?c=line-stack"); 这个是App.xaml ``` <Application x:Class="HontyeNMR.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="UserControls/Page1.xaml" Startup="Application_Startup"> <Application.Resources> <!--空按钮--> <Style x:Key="EmptyButton" TargetType="Button"> <Setter Property="Padding" Value="0"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <ContentPresenter Content="{TemplateBinding Content}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonBlue" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#00A5DB" Offset="0.5"/> <GradientStop Color="#00A5DB" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#0095DB" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#0095DB" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#0085DB" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#0085DB" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonYellow" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#FF8800" Offset="0.5"/> <GradientStop Color="#FF8800" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#FF7700" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#FF7700" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#FF6600" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#FF6600" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonRed" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#EC4040" Offset="0.5"/> <GradientStop Color="#EC4040" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#EC5050" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#EC5050" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#EC6060" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#EC6060" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--定义按钮样式--> <Style x:Key="ButtonGray" TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType="Button"> <!--背景色--> <Border x:Name="back" Opacity="0.8" CornerRadius="3"> <Border.BitmapEffect> <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" /> </Border.BitmapEffect> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/> <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/> <GradientStop Color="#FFF" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--前景色及边框--> <Border x:Name="fore" CornerRadius="3" > <!--BorderThickness="0" BorderBrush="#2388BE"--> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#C8C8C8" Offset="0.5"/> <GradientStop Color="#C8C8C8" Offset="0.51"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <!--按钮内容--> <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"> <!--<ContentPresenter.BitmapEffect> <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="0" Softness="0.1" Opacity="1" /> </ContentPresenter.BitmapEffect>--> </ContentPresenter> </Border> </Border> <!--触发器--> <ControlTemplate.Triggers> <!--鼠标移入移出--> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#B8B8B8" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#B8B8B8" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮按下弹起--> <Trigger Property="IsPressed" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation To="#A8A8A8" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#A8A8A8" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <!--按钮失效--> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="#B444"/> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" /> <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <!--滚动条样式Start--> <ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}"> <Grid x:Name="Grid" Background="{TemplateBinding Background}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Rectangle x:Name="Corner" Grid.Column="1" Fill="White" Grid.Row="1"/> <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/> <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource MyScrollBarStyle}"/> <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Style="{DynamicResource MyScrollBarStyle}"/> </Grid> </ControlTemplate> <!-- 应该在此定义资源字典条目。--> <SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4"/> <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Focusable" Value="false"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type RepeatButton}"> <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Thumb}"> <Rectangle Name="thumbRect" Fill="LightGray" RadiusX="3" RadiusY="3"/> <!--滚动条颜色--> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Fill" Value="Gray" TargetName="thumbRect" /> <!--滚动条选中颜色--> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="Focusable" Value="false"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type RepeatButton}"> <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="MyScrollBarStyle" TargetType="{x:Type ScrollBar}"> <Setter Property="Background" Value="AliceBlue"/> <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> <Setter Property="Stylus.IsFlicksEnabled" Value="false"/> <Setter Property="Width" Value="6"/> <Setter Property="MinWidth" Value="6"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ScrollBar}"> <Grid x:Name="Bg" Background="AliceBlue" SnapsToDevicePixels="true" Width="6"> <Grid.RowDefinitions> <RowDefinition /> </Grid.RowDefinitions> <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}"> <Track.DecreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> </Track.DecreaseRepeatButton> <Track.IncreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> </Track.IncreaseRepeatButton> <Track.Thumb> <Thumb Style="{StaticResource ScrollBarThumb}"/> </Track.Thumb> </Track> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="Orientation" Value="Horizontal"> <Setter Property="Width" Value="Auto"/> <Setter Property="MinWidth" Value="0"/> <Setter Property="Height" Value="6"/> <Setter Property="MinHeight" Value="6"/> <Setter Property="Background" Value="AliceBlue"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ScrollBar}"> <Grid x:Name="Bg" Background="AliceBlue" SnapsToDevicePixels="true"> <Grid.ColumnDefinitions> <ColumnDefinition /> </Grid.ColumnDefinitions> <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}"> <Track.DecreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> </Track.DecreaseRepeatButton> <Track.IncreaseRepeatButton> <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> </Track.IncreaseRepeatButton> <Track.Thumb> <Thumb Style="{StaticResource ScrollBarThumb}" /> </Track.Thumb> </Track> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <!--滚动条样式End--> </Application.Resources> </Application> ``` 下面是MainWindow ``` <Window x:Class="MR.MainWindow" 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:MR" mc:Ignorable="d" Title="MainWindow" Height="800" Width="1000"> <Grid> <StackPanel x:Name="asd"></StackPanel> </Grid> </Window> Page1 page1 = new Page1(); this.Content = page1; ```
写了一个html/css的语言,可是CSS中除了可以显示底色,其它都显示不出来(包括页边距、线条的样式等)?
<html> <head> <title>Starbuzz Coffee</title> <style type="text/css"> body{ background-color:#d2b48c; margin-left:20% margin-right:20%; border:2px dotted black; padding:10px 10px 10px 10px; font-family:sans-serif } </style> </head> <body> <h1>Starbuzz Coffee Beverages</h1> <h2>House Blend,$1.49</h2> <p>A smooth,mild blend of coffee from Mexico,Bolivia and Guatemala.</p> <h2>Mocha Cafe Latte,$2.35</h2> <p>Espresso,Steamed milk and chocolate syrup.</p> <h2>Cappuccino,$1.89</h2> <p>A mixture of espresso,steamed milk and foam.</p> <h2>Chai Tea,$1.85</h2> <p>A Spicy drink made with black tea,spices,milk and honey.</p> </body> </html> ![图片说明](https://img-ask.csdn.net/upload/201910/13/1570980115_406374.png)
wpf导入3ds max生成的obj文件,发现贴图位置不对
在使用expression blend 4 导入3ds max导出的obj文件时,发现展示出来的效果出现了贴图位置不对的情况,如下图:![图片说明](https://img-ask.csdn.net/upload/201909/11/1568171829_957027.png) 我使用的是win10 64位系统,我用系统自带的3d build和3dview查看obj文件,发现文件效果展示正常,如下图:![图片说明](https://img-ask.csdn.net/upload/201909/11/1568171930_352550.png) 现在不清楚是什么原因,猜测可能是因为blend中的坐标体系与其他的不一样,造成贴图位置无法正确对应,但网络上没有相关问题的解决方案,在这边请教各位大神。[源文件及obj文件](链接: https://pan.baidu.com/s/1zybIzR4DRWstqH8oYtjmiA 提取码: i61i "")
WPF动画找不到依赖属性:属性未指向路径“(0).(1)[3].(2)”中的 DependencyObject
# 这是代码: ``` <Window x:Class="Ani.MainWindow" 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Ani" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" Height="600" Width="1080" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowStyle="None"> <Window.Resources> <Storyboard x:Key="CloseMenu"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="GridMenu"> <EasingDoubleKeyFrame KeyTime="0" Value="250"/> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="GridBackground"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="OpenMenu"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="GridMenu"> <EasingDoubleKeyFrame KeyTime="0" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="250"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="GridBackground"> <EasingDoubleKeyFrame KeyTime="0" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonClose"> <BeginStoryboard x:Name="CLoseMenu_BeginStoryBoard" Storyboard="{DynamicResource CloseMenu}"/> </EventTrigger> <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpen"> <BeginStoryboard Storyboard="{DynamicResource OpenMenu}"/> </EventTrigger> </Window.Triggers> <Grid> <Grid x:Name="GridBackground" Background="#55313131" Opacity="0"> <Grid.RenderTransform> <TransformGroup> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </TransformGroup> </Grid.RenderTransform> </Grid> <Button Name="ButtonOpen" Background="Transparent" BorderBrush="Transparent" Click="ButtonClose_Click" Width="40" Height="40" Margin="0,0,1040,560" > <materialDesign:PackIcon Kind="Menu" Height="25" Width="28" Foreground="Gray" Padding="0"/> </Button> <Grid x:Name="GridMenu" Width="250" HorizontalAlignment="Left" Margin="-250,0,0,0" Background="White" RenderTransformOrigin="0.5,0.5"> <Grid.RenderTransform> <TransformGroup> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </TransformGroup> </Grid.RenderTransform> <StackPanel> <Image Height="140" Stretch="Fill"> <Image.Source> <BitmapImage UriSource="file:///C:/Users/Jeremy/Desktop/yuanjian/Practice/Pic/timg.jpg"/> </Image.Source> </Image> <ListView Foreground="#FF313131" FontFamily="Chamoagne &amp; Limousines" FontSize="18" BorderBrush="Transparent"> <ListViewItem Height="45" Padding="0"> <StackPanel Orientation="Horizontal" Margin="10 0"> <materialDesign:PackIcon Kind="Recycle" Width="20" Height="20" VerticalAlignment="Center" Margin="5" Foreground="Gray"/> <TextBlock Text="Recycle" Margin="10"/> </StackPanel> </ListViewItem> <ListViewItem Height="45" Padding="0"> <StackPanel Orientation="Horizontal" Margin="10 0"> <materialDesign:PackIcon Kind="HelpCircleOutline" Width="20" Height="20" VerticalAlignment="Center" Margin="5" Foreground="#FFF08033"/> <TextBlock Text="Help" Margin="10"/> </StackPanel> </ListViewItem> <ListViewItem Height="45" Padding="0"> <StackPanel Orientation="Horizontal" Margin="10 0"> <materialDesign:PackIcon Kind="Lightbulb" Width="20" Height="20" VerticalAlignment="Center" Margin="5" Foreground="Green"/> <TextBlock Text="Send Feedback" Margin="10"/> </StackPanel> </ListViewItem> <ListViewItem Height="45" Padding="0"> <StackPanel Orientation="Horizontal" Margin="10 0"> <materialDesign:PackIcon Kind="Heart" Width="20" Height="20" VerticalAlignment="Center" Margin="5" Foreground="#FFD41515"/> <TextBlock Text="Recommend" Margin="10"/> </StackPanel> </ListViewItem> <ListViewItem Height="45" Padding="0"> <StackPanel Orientation="Horizontal" Margin="10 0"> <materialDesign:PackIcon Kind="StarCircle" Width="20" Height="20" VerticalAlignment="Center" Margin="5" Foreground="#FFE6A701"/> <TextBlock Text="Premiun Subscription" Margin="10"/> </StackPanel> </ListViewItem> <ListViewItem Height="45" Padding="0"> <StackPanel Orientation="Horizontal" Margin="10 0"> <materialDesign:PackIcon Kind="Settings" Width="20" Height="20" VerticalAlignment="Center" Margin="5" Foreground="#FF0069C1"/> <TextBlock Text="Settings" Margin="10"/> </StackPanel> </ListViewItem> </ListView> </StackPanel> <Button Name="ButtonClose" Margin="216,0,0,571" Background="Transparent" BorderBrush="Transparent" Height="40" Width="40" Click="ButtonClose_Click" > <materialDesign:PackIcon Kind="Close" Height="25" Width="28" Foreground="White" Padding="0"/> </Button> </Grid> </Grid> </Window> ``` ## 为什么我在Grid里写了TransformGroup,运行时还是出错了? ![图片说明](https://img-ask.csdn.net/upload/201907/10/1562727684_705489.png) 这是写界面时的样子 ## 报错![图片说明](https://img-ask.csdn.net/upload/201907/10/1562727799_632012.png) 大神帮帮看看哪里出了问题~
在opencv的图像拼接stitch_detail.cpp中怎么计算子图像的xyz平移量?
在opencv自带的例子stitch_detail.cpp中,计算出来的CameraParams::R矩阵可以计算出图像的每个坐标的旋转量。但是每一幅图最后的位置(左上原点的坐标)怎么确定?怎么获得图像xyz轴的平移量?(z轴应该是指图像的缩放) 调整图像(透视变换)的代码片段如下: ``` is_compose_scale_set = false; // false Mat img_warped, img_warped_s; Mat dilated_mask, seam_mask, mask, mask_warped; Ptr<Blender> blender; double compose_seam_aspect = 1; double compose_work_aspect = 1; Mat full_img; Ptr<RotationWarper> warper; Ptr<WarperCreator> warper_creator; #if defined(HAVE_OPENCV_GPU) if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0){ warper_creator = new cv::PlaneWarperGpu(); }else #endif { warper_creator = new cv::PlaneWarper(); } for(int img_idx = 0; img_idx < precom_num; ++img_idx){ full_img = img_OriMat[img_idx]; if (!is_compose_scale_set) // 合成等级设定 { if (compose_megapix > 0) compose_scale = min(1.0, sqrt(compose_megapix * 1e6 / full_img.size().area())); is_compose_scale_set = true; // Compute relative scales //compose_seam_aspect = compose_scale / seam_scale; compose_work_aspect = compose_scale / work_scale; // Update warped image scale warped_image_scale *= static_cast<float>(compose_work_aspect); warper = warper_creator->create(warped_image_scale); // Update corners and sizes for (int i = 0; i < precom_num; ++i){ // Update intrinsics cameras[i].focal *= compose_work_aspect; cameras[i].ppx *= compose_work_aspect; cameras[i].ppy *= compose_work_aspect; // Update corner and size Size sz = full_img_sizes[i]; if (std::abs(compose_scale - 1) > 1e-1) { sz.width = cvRound(full_img_sizes[i].width * compose_scale); sz.height = cvRound(full_img_sizes[i].height * compose_scale); } Mat K; cameras[i].K().convertTo(K, CV_32F); Rect roi = warper->warpRoi(sz, K, cameras[i].R); // corners[i] = roi.tl(); sizes[i] = roi.size(); } } Mat img; // 增加 if (abs(compose_scale - 1) > 1e-1) cv::resize(full_img, img, Size(), compose_scale, compose_scale); else img = full_img; full_img.release(); Size img_size = img.size(); Mat K; cameras[img_idx].K().convertTo(K, CV_32F); warper->warp(img, K, cameras[img_idx].R, INTER_LINEAR, BORDER_REFLECT, img_warped); // Warp the current image mask mask.create(img_size, CV_8U); mask.setTo(Scalar::all(255)); warper->warp(mask, K, cameras[img_idx].R, INTER_NEAREST, BORDER_CONSTANT, mask_warped); img_warped.convertTo(img_warped_s, CV_16S); img_warped.release(); img.release(); mask.release(); cv::dilate(mask_warped, dilated_mask, Mat()); // 膨胀 cv::resize(dilated_mask, seam_mask, mask_warped.size()); mask_warped = seam_mask & mask_warped; if (blender.empty()) { blender = Blender::createDefault(0, try_gpu); Size dst_sz = resultRoi(corners, sizes).size(); // 获得最终画布的大小 float blend_width = sqrt(static_cast<float>(dst_sz.area())) * 5 / 100.f; if (blend_width < 1.f) blender = Blender::createDefault(Blender::NO, try_gpu); blender->prepare(corners, sizes); } // Blend the current image blender->feed(img_warped_s, mask_warped, corners[img_idx]); char ppa[100] = {0}; sprintf_s(ppa,100,"img_warped_s_%d.jpg",img_idx); imwrite(ppa, img_warped_s); } // for end Mat result, result_mask; blender->blend(result, result_mask); // 返回图像 return result; ``` 查了代码发现,除了R,corners会影响拼接图像的原点坐标,sizes是其大小。在warpers_inl.hpp中又看到: ``` template <class P> Rect RotationWarperBase<P>::warpRoi(Size src_size, const Mat &K, const Mat &R) { projector_.setCameraParams(K, R); Point dst_tl, dst_br; detectResultRoi(src_size, dst_tl, dst_br); return Rect(dst_tl, Point(dst_br.x + 1, dst_br.y + 1)); } ``` setCameraParams的定义在warpers.cpp中: ``` void ProjectorBase::setCameraParams(const Mat &K, const Mat &R, const Mat &T) { CV_Assert(K.size() == Size(3, 3) && K.type() == CV_32F); CV_Assert(R.size() == Size(3, 3) && R.type() == CV_32F); CV_Assert((T.size() == Size(1, 3) || T.size() == Size(3, 1)) && T.type() == CV_32F); Mat_<float> K_(K); k[0] = K_(0,0); k[1] = K_(0,1); k[2] = K_(0,2); k[3] = K_(1,0); k[4] = K_(1,1); k[5] = K_(1,2); k[6] = K_(2,0); k[7] = K_(2,1); k[8] = K_(2,2); Mat_<float> Rinv = R.t(); rinv[0] = Rinv(0,0); rinv[1] = Rinv(0,1); rinv[2] = Rinv(0,2); rinv[3] = Rinv(1,0); rinv[4] = Rinv(1,1); rinv[5] = Rinv(1,2); rinv[6] = Rinv(2,0); rinv[7] = Rinv(2,1); rinv[8] = Rinv(2,2); Mat_<float> R_Kinv = R * K.inv(); r_kinv[0] = R_Kinv(0,0); r_kinv[1] = R_Kinv(0,1); r_kinv[2] = R_Kinv(0,2); r_kinv[3] = R_Kinv(1,0); r_kinv[4] = R_Kinv(1,1); r_kinv[5] = R_Kinv(1,2); r_kinv[6] = R_Kinv(2,0); r_kinv[7] = R_Kinv(2,1); r_kinv[8] = R_Kinv(2,2); Mat_<float> K_Rinv = K * Rinv; k_rinv[0] = K_Rinv(0,0); k_rinv[1] = K_Rinv(0,1); k_rinv[2] = K_Rinv(0,2); k_rinv[3] = K_Rinv(1,0); k_rinv[4] = K_Rinv(1,1); k_rinv[5] = K_Rinv(1,2); k_rinv[6] = K_Rinv(2,0); k_rinv[7] = K_Rinv(2,1); k_rinv[8] = K_Rinv(2,2); Mat_<float> T_(T.reshape(0, 3)); t[0] = T_(0,0); t[1] = T_(1,0); t[2] = T_(2,0); } ``` 其中的参数的定义在warpers.hpp中: ``` struct CV_EXPORTS ProjectorBase { void setCameraParams(const Mat &K = Mat::eye(3, 3, CV_32F), const Mat &R = Mat::eye(3, 3, CV_32F), const Mat &T = Mat::zeros(3, 1, CV_32F)); float scale; float k[9]; float rinv[9]; float r_kinv[9]; float k_rinv[9]; float t[3]; }; ``` detectResultRoi的定义在warpers_inl.hpp中: ``` template <class P> void RotationWarperBase<P>::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) { float tl_uf = std::numeric_limits<float>::max(); float tl_vf = std::numeric_limits<float>::max(); float br_uf = -std::numeric_limits<float>::max(); float br_vf = -std::numeric_limits<float>::max(); float u, v; for (int y = 0; y < src_size.height; ++y) { for (int x = 0; x < src_size.width; ++x) { projector_.mapForward(static_cast<float>(x), static_cast<float>(y), u, v); tl_uf = std::min(tl_uf, u); tl_vf = std::min(tl_vf, v); br_uf = std::max(br_uf, u); br_vf = std::max(br_vf, v); } } dst_tl.x = static_cast<int>(tl_uf); dst_tl.y = static_cast<int>(tl_vf); dst_br.x = static_cast<int>(br_uf); dst_br.y = static_cast<int>(br_vf); } ``` 请问大家有知道这之中是用什么算法算的吗?能不能给点资料或者提示? 目前已知的是: corners的计算和R矩阵有关,但是计算过程不明了。 corners的xy值应该可以对应着图像的原点,但是打印出来是负数,不理解。 sizes应该有缩放的信息,可能对应着z的平移量。 先谢过啦!
unity3d中加入shader后材质球的颜色变为黑色的问题
我想在unity中给cube添加轮廓线,从某个帖子中得知shader可以实现,还给了一段shader的代码,但是只要给材质球挂载上这个shader,轮廓是有了,但是材质球会变成黑色。麻烦各位大神给看看,是不是这个shader哪里写的有问题 ``` Shader "Custom/NewSurfaceShader" { Properties { //定义材质的颜色为白色 _Color ("Main Color", Color) = (1,1,1,1) //定义材质的轮廓线为黑色 _OutlineColor ("Outline Color", Color) = (0,0,0,1) //改变这个能改变轮廓边的颜色 //定义线宽 _Outline ("Outline width", Range (0.0, 0.03)) = 0.001 //改变这个能改变轮廓边的粗细 _MainTex ("Base (RGB)", 2D) = "white" { } } CGINCLUDE #include "UnityCG.cginc" struct appdata { float4 vertex : POSITION; float3 normal : NORMAL; }; struct v2f { float4 pos : POSITION; float4 color : COLOR; }; uniform float _Outline; uniform float4 _OutlineColor; v2f vert(appdata v) { // just make a copy of incoming vertex data but scaled according to normal direction v2f o; o.pos = mul(UNITY_MATRIX_MVP, v.vertex); float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); float2 offset = TransformViewToProjection(norm.xy); o.pos.xy += offset * o.pos.z * _Outline; o.color = _OutlineColor; return o; } ENDCG SubShader { Tags { "Queue" = "Transparent" } // note that a vertex shader is specified here but its using the one above Pass { Name "OUTLINE" Tags { "LightMode" = "Always" } Cull Off ZWrite Off ZTest Always ColorMask RGB // alpha not used // you can choose what kind of blending mode you want for the outline Blend SrcAlpha OneMinusSrcAlpha // Normal //Blend One One // Additive //Blend One OneMinusDstColor // Soft Additive //Blend DstColor Zero // Multiplicative //Blend DstColor SrcColor // 2x Multiplicative CGPROGRAM #pragma vertex vert #pragma fragment frag half4 frag(v2f i) :COLOR { return i.color; } ENDCG } Pass { Name "BASE" ZWrite On ZTest LEqual Blend SrcAlpha OneMinusSrcAlpha Material { Diffuse [_Color] Ambient [_Color] } Lighting On SetTexture [_MainTex] { ConstantColor [_Color] Combine texture * constant } SetTexture [_MainTex] { Combine previous * primary DOUBLE } } } SubShader { Tags { "Queue" = "Transparent" } Pass { Name "OUTLINE" Tags { "LightMode" = "Always" } Cull Front ZWrite Off ZTest Always ColorMask RGB // you can choose what kind of blending mode you want for the outline Blend SrcAlpha OneMinusSrcAlpha // Normal //Blend One One // Additive //Blend One OneMinusDstColor // Soft Additive //Blend DstColor Zero // Multiplicative //Blend DstColor SrcColor // 2x Multiplicative CGPROGRAM #pragma vertex vert #pragma exclude_renderers gles xbox360 ps3 ENDCG SetTexture [_MainTex] { combine primary } } Pass { Name "BASE" ZWrite On ZTest LEqual Blend SrcAlpha OneMinusSrcAlpha Material { Diffuse [_Color] Ambient [_Color] } Lighting On SetTexture [_MainTex] { ConstantColor [_Color] Combine texture * constant } SetTexture [_MainTex] { Combine previous * primary DOUBLE } } } Fallback "Diffuse" } ``` ![图片说明](https://img-ask.csdn.net/upload/201610/26/1477449766_40855.png)
opencv release下程序运行报错,求指教ORZ
多相机参数标定。VS2015+opencv2.4.13 代码运行到匹配关系那一部分就会崩。虽然找到了问题在哪,但不会解决,求大神指教。报错内容为:0x00007FF8DCE3D3D8 (ucrtbase.dll) (calib_stitch.exe 中)处有未经处理的异常: 将一个无效参数传递给了将无效参数视为严重错误的函数。 下面是代码: #include <iostream> #include <fstream> #include <string> #include "opencv2/core/core.hpp" #include "opencv2/opencv_modules.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/detail/autocalib.hpp" #include "opencv2/stitching/detail/blenders.hpp" #include "opencv2/stitching/detail/camera.hpp" #include "opencv2/stitching/detail/exposure_compensate.hpp" #include "opencv2/stitching/detail/matchers.hpp" #include "opencv2/stitching/detail/motion_estimators.hpp" #include "opencv2/stitching/detail/seam_finders.hpp" #include "opencv2/stitching/detail/util.hpp" #include "opencv2/stitching/detail/warpers.hpp" #include "opencv2/stitching/warpers.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/nonfree/nonfree.hpp" #include <opencv2/calib3d/calib3d.hpp> using namespace std; using namespace cv; using namespace cv::detail; // Default command line args bool preview = false; bool try_gpu = false; double work_megapix = -0.6; // 缩放参数 double seam_megapix = 0.1; double compose_megapix = -1; float conf_thresh = 1.f; string features_type = "sift"; //orb surf sift string ba_cost_func = "reproj"; //reproj ray string ba_refine_mask = "xxllx"; bool do_wave_correct = true; WaveCorrectKind wave_correct = detail::WAVE_CORRECT_HORIZ; bool save_graph = true; std::string save_graph_to; string warp_type = "spherical"; //spherical cylindrical plane int expos_comp_type = ExposureCompensator::GAIN_BLOCKS; //GAIN,OR NO float match_conf = 0.3f; string seam_find_type = "gc_color"; //no voronoi gc_color gc_colorgrad dp_color dp_colorgrad int blend_type = Blender::MULTI_BAND; // Blender::FEATHER Blender::MULTI_BAND float blend_strength = 5;//0就是关,默认5 string result_name = "result.jpg"; void detection(const vector<string> imagelist, vector<vector<Point2f>>& ransac_image_points_seq) { if (imagelist.size() % 2 != 0) { cout << "Error: the image list contains odd (non-even) number of elements\n"; return; } bool displayCorners = true;//true; const int maxScale = 2; const float squareSize = 1.f; // Set this to your actual square size // ARRAY AND VECTOR STORAGE: Size boardSize = Size(11, 8); vector<vector<Point2f>> imagePoints[2]; vector<vector<Point3f> > objectPoints; Size imageSize; int i, j, k, nimages = (int)imagelist.size() / 2; imagePoints[0].resize(nimages); imagePoints[1].resize(nimages); vector<string> goodImageList; for (i = j = 0; i < nimages; i++) { for (k = 0; k < 2; k++) { const string& filename = imagelist[i * 2 + k]; Mat img = imread(filename, 0); if (img.empty()) break; if (imageSize == Size()) imageSize = img.size(); else if (img.size() != imageSize) { cout << "The image " << filename << " has the size different from the first image size. Skipping the pair\n"; break; } bool found = false; vector<Point2f>& corners = imagePoints[k][j]; for (int scale = 1; scale <= maxScale; scale++) { Mat timg; if (scale == 1) timg = img; else resize(img, timg, Size(), scale, scale); found = findChessboardCorners(timg, boardSize, corners, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_NORMALIZE_IMAGE); if (found) { if (scale > 1) { Mat cornersMat(corners); cornersMat *= 1. / scale; } break; } } if (displayCorners) { //cout << filename << endl; Mat cimg, cimg1; cvtColor(img, cimg, COLOR_GRAY2BGR); drawChessboardCorners(cimg, boardSize, corners, found); double sf = 640. / MAX(img.rows, img.cols); resize(cimg, cimg1, Size(), sf, sf); namedWindow("corners", 0); imshow("corners", cimg1); char c = (char)waitKey(1); if (c == 27 || c == 'q' || c == 'Q') //Allow ESC to quit exit(-1); } else putchar('.'); if (!found) break; cornerSubPix(img, corners, Size(11, 11), Size(-1, -1), TermCriteria(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 30, 0.01)); /* 亚像素精确化 */ //find4QuadCornerSubpix(img, corners, Size(5, 5)); //对粗提取的角点进行精确化 } if (k == 2) { goodImageList.push_back(imagelist[i * 2]); goodImageList.push_back(imagelist[i * 2 + 1]); j++; } } cout << j << " pairs have been successfully detected.\n"; nimages = j; if (nimages < 2) { cout << "Error: too little pairs to run the calibration\n"; return; } imagePoints[0].resize(nimages); imagePoints[1].resize(nimages); vector<vector<Point2f>> image_points_seq; for (int i = 0; i < 2; i++) { vector<Point2f> buf; for (int j = 0; j < imagePoints[i].size(); j++) { for (int k = 0; k < imagePoints[i][j].size(); k++) { buf.push_back(imagePoints[i][j][k]); } } image_points_seq.push_back(buf); } //RANSAC cout << image_points_seq[0].size() << endl; cout << image_points_seq[1].size() << endl; vector<uchar> mask; Mat h = findHomography(image_points_seq[0], image_points_seq[1], mask, CV_FM_RANSAC); vector<Point2f> point1, point2; for (int i = 0; i < image_points_seq[0].size(); i++) { //if (mask[i] == 1) { point1.push_back(image_points_seq[0][i]); point2.push_back(image_points_seq[1][i]); } } ransac_image_points_seq.push_back(point1); ransac_image_points_seq.push_back(point2); //cout << imagePoints[0].size() << endl; //cout << imagePoints[1].size() << endl; //return imagePoints; } int main(int argc, char* argv[]) { int64 app_start_time = getTickCount(); string xml_name = "144-146-147-1481.yaml"; vector<vector<string>> img_names; vector<vector<string>> names; char file_name[256]; int num_pairs = 3; int nums_pairs_count[4] = { 23,23,20 }; for (int i =0; i <= num_pairs; i++) { vector<string> temp; for (int j = 1; j <= nums_pairs_count[i]; j++) { sprintf(file_name, "1234/%d/1/(%d).jpg", i, j); temp.push_back(file_name); sprintf(file_name, "1234/%d/2/(%d).jpg", i, j); temp.push_back(file_name); } names.push_back(temp); } //棋盘格检测 vector<vector<Point2f>> double_image_points_seq; int match_num[4][4] = {0}; int match_start[4][4][2] = {0}; //vector<vector<Point2f>> ransac_image_points_seq; //detection(names[0], ransac_image_points_seq); //match_num[0][1] = ransac_image_points_seq[0].size(); //match_num[1][0] = ransac_image_points_seq[0].size(); //match_start[0][1] = 0; //match_start[1][0] = 0; //match_num.push_back(ransac_image_points_seq[0].size()); //cout << ransac_image_points_seq[0].size() << endl; //cout << ransac_image_points_seq[1].size() << endl; for (int i = 0; i < num_pairs; i++) { vector<vector<Point2f>> ransac_image_points_seq; detection(names[i], ransac_image_points_seq); if (i != 0) { match_num[i][i + 1] = ransac_image_points_seq[0].size(); match_num[i+1][i] = ransac_image_points_seq[0].size(); match_start[i][i + 1][0] = match_num[i - 1][i]; match_start[i][i + 1][1] = 0; match_start[i+1][i][0] = 0; match_start[i+1][i][1] = match_num[i - 1][i]; for (int j = 0; j < ransac_image_points_seq[0].size(); j++) { double_image_points_seq[double_image_points_seq.size() - 1].push_back(ransac_image_points_seq[0][j]); } double_image_points_seq.push_back(ransac_image_points_seq[1]); } else { double_image_points_seq.push_back(ransac_image_points_seq[0]); double_image_points_seq.push_back(ransac_image_points_seq[1]); match_num[0][1] = ransac_image_points_seq[0].size(); match_num[1][0] = ransac_image_points_seq[0].size(); match_start[0][1][0] = 0; match_start[0][1][1] = 0; match_start[1][0][0] = 0; match_start[1][0][1] = 0; } } //特征点 vector<ImageFeatures> features(num_pairs + 1); for (int i = 0; i <= num_pairs; i++) { vector<KeyPoint> keypoints; for (int j = 0; j < double_image_points_seq[i].size(); j++) { KeyPoint point; point.pt = double_image_points_seq[i][j]; keypoints.push_back(point); } features[i].keypoints = keypoints; features[i].img_size = Size(2560, 1440); features[i].img_idx = i; } //匹配关系 vector<MatchesInfo> pairwise_matches; for (int i = 0; i <= num_pairs; i++) { for (int j = 0; j <= num_pairs; j++) { MatchesInfo matches_info; if(j==i+1 || j==i-1) { vector<DMatch> match(match_num[i][j]); vector<uchar> mask(match_num[i][j]); for (int n = 0; n < match_num[i][j]; n++) { match[n].queryIdx = match_start[i][j][0] + n; match[n].trainIdx = match_start[i][j][1] + n; mask[n] = 1; } matches_info.src_img_idx = i; matches_info.dst_img_idx = j; matches_info.matches = match; //info.inliers_mask = inliers_mask; //info.num_inliers = match_num[i][j]; //vector<Point2f> pts_src, pts_dst; Mat src_points(1, static_cast<int>(matches_info.matches.size()), CV_32FC2); Mat dst_points(1, static_cast<int>(matches_info.matches.size()), CV_32FC2); for (int n = 0; n < match_num[i][j]; n++) { const DMatch& m = matches_info.matches[n]; Point2f p = features[i].keypoints[m.queryIdx].pt; p.x -= features[i].img_size.width * 0.5f; p.y -= features[i].img_size.height * 0.5f; src_points.at<Point2f>(0, static_cast<int>(n)) = p; p = features[j].keypoints[m.trainIdx].pt; p.x -= features[j].img_size.width * 0.5f; p.y -= features[j].img_size.height * 0.5f; dst_points.at<Point2f>(0, static_cast<int>(n)) = p; //pts_src.push_back(features[i].keypoints[match[n].queryIdx].pt); //pts_dst.push_back(features[j].keypoints[match[n].trainIdx].pt); } //vector<uchar> mask; matches_info.H = findHomography(src_points, dst_points, matches_info.inliers_mask,CV_FM_RANSAC); //matches_info.H = h.clone(); matches_info.num_inliers = 0; for (size_t i = 0; i < matches_info.inliers_mask.size(); ++i) if (matches_info.inliers_mask[i]) matches_info.num_inliers++; //info.confidence = 2; matches_info.confidence = matches_info.num_inliers / (8 + 0.3 * matches_info.matches.size()); // Set zero confidence to remove matches between too close images, as they don't provide // additional information anyway. The threshold was set experimentally. matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence; //// Construct point-point correspondences for inliers only src_points.create(1, matches_info.num_inliers, CV_32FC2); dst_points.create(1, matches_info.num_inliers, CV_32FC2); int inlier_idx = 0; for (size_t n = 0; n < matches_info.matches.size(); ++n) { if (!matches_info.inliers_mask[n]) continue; const DMatch& m = matches_info.matches[n]; Point2f p = features[i].keypoints[m.queryIdx].pt; p.x -= features[i].img_size.width * 0.5f; p.y -= features[i].img_size.height * 0.5f; src_points.at<Point2f>(0, inlier_idx) = p; p = features[j].keypoints[m.trainIdx].pt; p.x -= features[j].img_size.width * 0.5f; p.y -= features[j].img_size.height * 0.5f; dst_points.at<Point2f>(0, inlier_idx) = p; inlier_idx++; } // Rerun motion estimation on inliers only matches_info.H = findHomography(src_points, dst_points, CV_RANSAC); } else { matches_info.src_img_idx = -1; matches_info.dst_img_idx = -1; } pairwise_matches.push_back(matches_info);//发现程序崩在哪一行了 } } cout << pairwise_matches.size() << endl; /*Mat img1 = imread(img_names[0], 1); Mat img2 = imread(img_names[1], 1); Mat out1, out2, out; drawKeypoints(img1, features[0].keypoints, out1); drawKeypoints(img1, features[0].keypoints, out2); drawMatches(img1, features[0].keypoints, img2, features[1].keypoints, pairwise_matches[0].matches, out); cv::namedWindow("out1", 0); cv::imshow("out1", out); cv::namedWindow("out2", 0); cv::imshow("out2", out); cv::namedWindow("out", 0); cv::imshow("out", out); cv::waitKey();*/ //for(int i=0; i<nu) HomographyBasedEstimator estimator; vector<CameraParams> cameras; estimator(features, pairwise_matches, cameras); for (size_t i = 0; i < cameras.size(); ++i) { Mat R; cameras[i].R.convertTo(R, CV_32F); cameras[i].R = R; //cout << "Initial intrinsics #" << indices[i] + 1 << ":\n" << cameras[i].K() << endl; } Mat K1(Matx33d( 1.2755404529239545e+03, 0., 1.3099971348805052e+03, 0., 1.2737998060528048e+03, 8.0764915313791903e+02, 0., 0., 1. )); Mat K2(Matx33d( 1.2832823446505638e+03, 0., 1.2250954954648896e+03, 0., 1.2831721912770793e+03, 7.1743301498758751e+02, 0., 0., 1. )); Mat K3(Matx33d( 1.2840711959594287e+03, 0., 1.2473666273838244e+03, 0., 1.2840499404560594e+03, 7.9051574509733359e+02, 0., 0., 1.)); Mat K4(Matx33d( 1.2865853945042952e+03, 0., 1.1876049192856492e+03, 0., 1.2869927339670007e+03, 6.2306976561458930e+02, 0., 0., 1. )); Mat K[4]; K[0] = K1.clone(); K[1] = K2.clone(); K[2] = K3.clone(); K[3] = K4.clone(); for (size_t i = 0; i < cameras.size(); ++i) { K[i].convertTo(K[i], CV_32F); } for (size_t i = 0; i < cameras.size(); ++i) { Mat R; cameras[i].R.convertTo(R, CV_32F); cameras[i].R = R; cameras[i].focal = 0.5*(K[i].at<float>(0, 0)+ K[i].at<float>(1, 1)); // Focal length cameras[i].ppx = K[i].at<float>(0,2); // Principal point X cameras[i].ppy = K[i].at<float>(1,2); ; // Principal point Y cout << cameras[i].K() << endl; //cout << "Initial intrinsics #" << indices[i] + 1 << ":\n" << cameras[i].K() << endl; } Ptr<detail::BundleAdjusterBase> adjuster; if (ba_cost_func == "reproj") adjuster = new detail::BundleAdjusterReproj(); else if (ba_cost_func == "ray") adjuster = new detail::BundleAdjusterRay(); else { cout << "Unknown bundle adjustment cost function: '" << ba_cost_func << "'.\n"; return -1; } adjuster->setConfThresh(conf_thresh); Mat_<uchar> refine_mask = Mat::zeros(3, 3, CV_8U); if (ba_refine_mask[0] == 'x') refine_mask(0, 0) = 1; if (ba_refine_mask[1] == 'x') refine_mask(0, 1) = 1; if (ba_refine_mask[2] == 'x') refine_mask(0, 2) = 1; if (ba_refine_mask[3] == 'x') refine_mask(1, 1) = 1; if (ba_refine_mask[4] == 'x') refine_mask(1, 2) = 1; adjuster->setRefinementMask(refine_mask); for (int i = 0; i < features.size(); i++) { features[i].descriptors = Mat(); } (*adjuster)(features, pairwise_matches, cameras); cout << "camera number: " << cameras.size() << endl; cv::FileStorage fs(xml_name, cv::FileStorage::WRITE); int num = cameras.size(); fs << "CameraNumber" << num; //char file_name[256]; for (int i = 0; i<cameras.size(); i++) { sprintf(file_name, "Focal_Camera%d", i); fs << file_name << cameras[i].focal; sprintf(file_name, "ppx_Camera%d", i); fs << file_name << cameras[i].ppx; sprintf(file_name, "ppy_Camera%d", i); fs << file_name << cameras[i].ppy; sprintf(file_name, "K_Camera%d", i); fs << file_name << cameras[i].K(); sprintf(file_name, "R_Camera%d", i); fs << file_name << cameras[i].R; } //fs << "indices" << indices; fs.release(); return 0; } ![图片说明](https://img-ask.csdn.net/upload/201904/12/1555002609_315025.png) ![图片说明](https://img-ask.csdn.net/upload/201904/12/1555002619_770672.png)
Silverlight中依赖属性设置出错
环境:Visual Studio 2010 Silverlight应用程序 实现类似微软人立方的人物关系图效果 但是出现如下错误: **未在类型“Button”中找到属性“CircleButtonWidth1” 。** 求大神给看一下,这个怎么改才可以?(附MainPage.xaml和MainPage.xaml.cs如下:) 首先是MailPage.xaml: **<UserControl x:Class="SilverlightApplication4.MainPage" 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SilverlightApplication4" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <UserControl.Resources> <Style x:Key="CircleButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid Height="auto" HorizontalAlignment="Center" VerticalAlignment="Center" Width="auto" IsHitTestVisible="True" Background="{x:Null}"> <Ellipse Margin="0,0,0,0" Stroke="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{TemplateBinding CircleButtonWidth1}" Height="{TemplateBinding CircleButtonHeight1}" IsHitTestVisible="False" x:Name="ellipse1" Fill="{TemplateBinding Ellipse1Fill}"> </Ellipse> <Grid Margin="0,0,0,0" HorizontalAlignment="Center" Width="1024" Height="1024" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" x:Name="grid" Opacity="1" Background="{x:Null}" IsHitTestVisible="True"> <Ellipse Fill="{TemplateBinding Ellipse2Fill}" Stroke="{TemplateBinding Ellipse2Stroke}" Margin="0,0,0,0" Width="{TemplateBinding CircleButtonWidth2}" Height="{TemplateBinding CircleButtonHeight2}" x:Name="ellipse2" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center"> </Ellipse> <Ellipse Margin="2,2,2,2" Fill="{TemplateBinding Ellipse3Fill}" Width="{TemplateBinding CircleButtonWidth3}" Height="{TemplateBinding CircleButtonHeight3}" x:Name="ellipse3" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center"> </Ellipse> <TextBlock Margin="0,0,0,0" FontFamily="Microsoft YaHei" FontSize="{TemplateBinding FontSize}" Foreground="#FFFFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="textBlock" Text="{TemplateBinding Content}" RenderTransformOrigin="0.5,0.5" IsHitTestVisible="False"> </TextBlock> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <Button Style="{StaticResource CircleButton}" Name="myButton" Content="Click me!!!" Click="myButton_Click_1" > </Button> </Grid> </UserControl>** 下面是MainPage.xaml.cs文件: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Reflection; namespace SilverlightApplication4 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void myButton_Click(object sender, RoutedEventArgs e) { } public partial class CircleButton : UserControl { static CircleButton() { Ellipse1FillProperty = DependencyProperty.Register("myEllipse1Fill", typeof(Brush), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnEllipse1FillPropertyChanged)));//Ellipse1FillProperty.OnEllipse1FillPropertyChanged Ellipse2FillProperty = DependencyProperty.Register("myEllipse2Fill", typeof(Brush), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnEllipse2FillPropertyChanged))); Ellipse3FillProperty = DependencyProperty.Register("myEllipse3Fill", typeof(Brush), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnEllipse3FillPropertyChanged))); CircleButtonWidth1Property = DependencyProperty.Register("myCircleButtonWidth1", typeof(Double), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnCircleButtonWidth1PropertyChanged))); CircleButtonWidth2Property = DependencyProperty.Register("myCircleButtonWidth2", typeof(Double), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnCircleButtonWidth2PropertyChanged))); CircleButtonWidth3Property = DependencyProperty.Register("myCircleButtonWidth3", typeof(Double), typeof(CircleButton), new PropertyMetadata("默认属性值", new PropertyChangedCallback(CircleButton.OnCircleButtonWidth3PropertyChanged))); } private static void OnEllipse1FillPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnEllipse1FillPropertyChanged(e); } private static void OnEllipse2FillPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnEllipse2FillPropertyChanged(e); } private static void OnEllipse3FillPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnEllipse3FillPropertyChanged(e); } private static void OnCircleButtonWidth1PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnCircleButtonWidth1PropertyChanged(e); } private static void OnCircleButtonWidth2PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnCircleButtonWidth2PropertyChanged(e); } private static void OnCircleButtonWidth3PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { (d as CircleButton).OnCircleButtonWidth3PropertyChanged(e); } public event DependencyPropertyChangedEventHandler Ellipse1FillPropertyChanged; public event DependencyPropertyChangedEventHandler Ellipse2FillPropertyChanged; public event DependencyPropertyChangedEventHandler Ellipse3FillPropertyChanged; public event DependencyPropertyChangedEventHandler CircleButtonWidth1PropertyChanged; public event DependencyPropertyChangedEventHandler CircleButtonWidth2PropertyChanged; public event DependencyPropertyChangedEventHandler CircleButtonWidth3PropertyChanged; void OnEllipse1FillPropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (Ellipse1FillPropertyChanged != null) { Ellipse1FillPropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnEllipse2FillPropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (Ellipse2FillPropertyChanged != null) { Ellipse2FillPropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnEllipse3FillPropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (Ellipse3FillPropertyChanged != null) { Ellipse3FillPropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnCircleButtonWidth1PropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (CircleButtonWidth1PropertyChanged != null) { CircleButtonWidth1PropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnCircleButtonWidth2PropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (CircleButtonWidth2PropertyChanged != null) { CircleButtonWidth2PropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } void OnCircleButtonWidth3PropertyChanged(DependencyPropertyChangedEventArgs e) { try { // Ellipse BgTextBlock = this.GetTemplateChild("ButtonCaption") as Ellipse; //BgTextBlock.Fill = e.NewValue as Brush; if (CircleButtonWidth3PropertyChanged != null) { CircleButtonWidth3PropertyChanged(null, e); } } catch (Exception ex) { string ks = ex.ToString(); } } //有些时候,我们希望在模板生效的时候就对某些模板成员进行操作,如绑定事件, //调整属性等,就需要一个事件OnApplyTemplate,我们只能通过override父类的OnApplyTemplate来响应模板生效 public override void OnApplyTemplate() { base.OnApplyTemplate(); try { var tb = GetTemplateChild("ButtonCaption") as Ellipse; //(GetTemplateChild("ButtonCaption") as Ellipse).Fill= this.Ellipse1Fill; tb.Fill= this.Ellipse1Fill; var tb2 = GetTemplateChild("ButtonCaption") as Ellipse; (GetTemplateChild("ButtonCaption") as Ellipse).Fill = this.Ellipse2Fill; var tb3 = GetTemplateChild("ButtonCaption") as Ellipse; (GetTemplateChild("ButtonCaption") as Ellipse).Fill = this.Ellipse3Fill; var we1 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonWidth1; var we2 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonWidth2; var we3 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonWidth3; var w1 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonHeight1; var w2 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonHeight2; var w3 = GetTemplateChild("ButtonCaption") as Ellipse; we1.Width = this.CircleButtonHeight3; } catch (Exception ex) { string ke = ex.ToString(); } } public Brush Ellipse1Fill { get { return (Brush)base.GetValue(Ellipse1FillProperty); } set { base.SetValue(Ellipse1FillProperty, value); } } public Brush Ellipse2Fill { get { return (Brush)base.GetValue(Ellipse2FillProperty); } set { base.SetValue(Ellipse2FillProperty, value); } } public Brush Ellipse3Fill { get { return (Brush)base.GetValue(Ellipse3FillProperty); } set { base.SetValue(Ellipse3FillProperty, value); } } public double CircleButtonWidth1 { get { return (double)base.GetValue(CircleButtonWidth1Property); } set { base.SetValue(CircleButtonWidth1Property, value); } } public double CircleButtonWidth2 { get { return (double)base.GetValue(CircleButtonWidth2Property); } set { base.SetValue(CircleButtonWidth2Property, value); } } public double CircleButtonWidth3 { get { return (double)base.GetValue(CircleButtonWidth3Property); } set { base.SetValue(CircleButtonWidth3Property, value); } } public double CircleButtonHeight1 { get { return (double)base.GetValue(CircleButtonHeight1Property); } set { base.SetValue(CircleButtonHeight1Property, value); } } public double CircleButtonHeight2 { get { return (double)base.GetValue(CircleButtonHeight2Property); } set { base.SetValue(CircleButtonHeight2Property, value); } } public double CircleButtonHeight3 { get { return (double)base.GetValue(CircleButtonHeight3Property); } set { base.SetValue(CircleButtonHeight3Property, value); } } ///<summary> /// /// Register property. ///</summary> public static readonly DependencyProperty Ellipse1FillProperty = DependencyProperty.Register("Ellipse1Fill", typeof(Brush), typeof(CircleButton), null); public static readonly DependencyProperty Ellipse2FillProperty = DependencyProperty.Register("Ellipse2Fill", typeof(Brush), typeof(CircleButton), null); public static readonly DependencyProperty Ellipse3FillProperty = DependencyProperty.Register("Ellipse3Fill", typeof(Brush), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonWidth1Property = DependencyProperty.Register("CircleButtonWidth1", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonWidth2Property = DependencyProperty.Register("CircleButtonWidth2", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonWidth3Property = DependencyProperty.Register("CircleButtonWidth3", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonHeight1Property = DependencyProperty.Register("CircleButtonHeight1", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonHeight2Property = DependencyProperty.Register("CircleButtonHeight2", typeof(double), typeof(CircleButton), null); public static readonly DependencyProperty CircleButtonHeight3Property = DependencyProperty.Register("CircleButtonHeight3", typeof(double), typeof(CircleButton), null); } private void myButton_Click_1(object sender, RoutedEventArgs e) { } } }
WPF的UserControl在Loaded事件处理函数里写东西会影响Blend的打开
如题,在一个WPF的UserControl里的Loaded事件处理函数里写诸如连接数据库取数据,或者设置某个控件的底图,但是那个底图不存在,反正种种在运行时可能会出错的代码写在它的Loaded里的,用Blend打开这个UserControl就会一直卡在那里打不开,而且我也试了下,用VS打开的话,也会出错,按道理在Loaded里面的语句应该是到运行时执行的,怎么会有在编辑器里打开的时候就运行的感觉,这是不是微软的一个bug,或者哪里可以设置在编辑器里打开是不执行Loaded里面的语句,或者它就是这样的特性没法改,求大侠指点。
用Blend4无法打开解决方案啊
用WPF写的一个项目,然后用Blend打开就报这样的错误“无法加载解决方案,将打开嵌套项目”,然后就一直卡到死。。
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n
进程通信方式总结与盘点
​ 进程通信是指进程之间的信息交换。这里需要和进程同步做一下区分,进程同步控制多个进程按一定顺序执行,进程通信是一种手段,而进程同步是目标。从某方面来讲,进程通信可以解决进程同步问题。 ​ 首先回顾下我们前面博文中讲到的信号量机制,为了实现进程的互斥与同步,需要在进程间交换一定的信息,因此信号量机制也可以被归为进程通信的一种方式,但是也被称为低级进程通信,主要原因为: 效率低:一次只可操作少量的...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
听说了吗?阿里双11作战室竟1根网线都没有
双11不光是购物狂欢节,更是对技术的一次“大考”,对于阿里巴巴企业内部运营的基础保障技术而言,亦是如此。 回溯双11历史,这背后也经历过“小米加步枪”的阶段:作战室从随处是网线,交换机放地上的“一地狼藉”;到如今媲美5G的wifi网速,到现场却看不到一根网线;从当年使用商用AP(无线路由器),让光明顶双11当天断网一分钟,到全部使用阿里自研AP……阿里巴巴企业智能事业部工程师们提供的基础保障...
在阿里,40岁的奋斗姿势
在阿里,40岁的奋斗姿势 在阿里,什么样的年纪可以称为老呢?35岁? 在云网络,有这样一群人,他们的平均年龄接近40,却刚刚开辟职业生涯的第二战场。 他们的奋斗姿势是什么样的呢? 洛神赋 “翩若惊鸿,婉若游龙。荣曜秋菊,华茂春松。髣髴兮若轻云之蔽月,飘飖兮若流风之回雪。远而望之,皎若太阳升朝霞;迫而察之,灼若芙蕖出渌波。” 爱洛神,爱阿里云 2018年,阿里云网络产品部门启动洛神2.0升...
关于研发效能提升的思考
研发效能提升是最近比较热门的一个话题,本人根据这几年的工作心得,做了一些思考总结,由于个人深度有限,暂且抛转引入。 三要素 任何生产力的提升都离不开这三个因素:人、流程和工具,少了其中任何一个因素都无法实现。 人,即思想,也就是古人说的“道”,道不同不相为谋,是制高点,也是高层建筑的基石。 流程,即方法,也是古人说的“法”。研发效能的提升,也就是要提高投入产出比,既要增加产出,也要减...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆  每天早上8:30推送 作者| Mr.K   编辑| Emma 来源| 技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯
程序员该看的几部电影
##1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?
入职阿里5年,他如何破解“技术债”?
简介: 作者 | 都铎 作为一名技术人,你常常会听到这样的话: “先快速上线” “没时间改” “再缓一缓吧” “以后再解决” “先用临时方案处理” …… 当你埋下的坑越来越多,不知道哪天哪位同学就会踩上一颗雷。特别赞同“人最大的恐惧就是未知,当技术债可说不可见的时候,才是最让人不想解决的时候。” 作为一个程序员,我们反对复制粘贴,但是我们经常会见到相似的代码,相同的二方包,甚至整个代码...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布了 2019年国民经济报告 ,报告中指出:年末中国大陆总人口(包括31个
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
Java坑人面试题系列: 包装类(中级难度)
Java Magazine上面有一个专门坑人的面试题系列: https://blogs.oracle.com/javamagazine/quiz-2。 这些问题的设计宗旨,主要是测试面试者对Java语言的了解程度,而不是为了用弯弯绕绕的手段把面试者搞蒙。 如果你看过往期的问题,就会发现每一个都不简单。 这些试题模拟了认证考试中的一些难题。 而 “中级(intermediate)” 和 “高级(ad
深度学习入门笔记(十八):卷积神经网络(一)
欢迎关注WX公众号:【程序员管小亮】 专栏——深度学习入门笔记 声明 1)该文章整理自网上的大牛和机器学习专家无私奉献的资料,具体引用的资料请看参考文献。 2)本文仅供学术交流,非商用。所以每一部分具体的参考资料并没有详细对应。如果某部分不小心侵犯了大家的利益,还望海涵,并联系博主删除。 3)博主才疏学浅,文中如有不当之处,请各位指出,共同进步,谢谢。 4)此属于第一版本,若有错误,还需继续修正与...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
节后首个工作日,企业们集体开晨会让钉钉挂了
By 超神经场景描述:昨天 2 月 3 日,是大部分城市号召远程工作的第一天,全国有接近 2 亿人在家开始远程办公,钉钉上也有超过 1000 万家企业活跃起来。关键词:十一出行 人脸...
Java基础知识点梳理
Java基础知识点梳理 摘要: 虽然已经在实际工作中经常与java打交道,但是一直没系统地对java这门语言进行梳理和总结,掌握的知识也比较零散。恰好利用这段时间重新认识下java,并对一些常见的语法和知识点做个总结与回顾,一方面为了加深印象,方便后面查阅,一方面为了学好java打下基础。 Java简介 java语言于1995年正式推出,最开始被命名为Oak语言,由James Gosling(詹姆
2020年全新Java学习路线图,含配套视频,学完即为中级Java程序员!!
新的一年来临,突如其来的疫情打破了平静的生活! 在家的你是否很无聊,如果无聊就来学习吧! 世上只有一种投资只赚不赔,那就是学习!!! 传智播客于2020年升级了Java学习线路图,硬核升级,免费放送! 学完你就是中级程序员,能更快一步找到工作! 一、Java基础 JavaSE基础是Java中级程序员的起点,是帮助你从小白到懂得编程的必经之路。 在Java基础板块中有6个子模块的学
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
你也能看懂的:蒙特卡罗方法
蒙特卡罗方法,也称统计模拟方法,是1940年代中期由于科学技术的发展和电子计算机的发明,而提出的一种以概率统计理论为指导的数值计算方法。是指使用随机数(或更常见的伪随机数)来解决很多计算问题的方法 蒙特卡罗方法可以粗略地分成两类:一类是所求解的问题本身具有内在的随机性,借助计算机的运算能力可以直接模拟这种随机的过程。另一种类型是所求解问题可以转化为某种随机分布的特征数,比如随机事件出现的概率,或...
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
相关热词 c# 为空 判断 委托 c#记事本颜色 c# 系统默认声音 js中调用c#方法参数 c#引入dll文件报错 c#根据名称实例化 c#从邮件服务器获取邮件 c# 保存文件夹 c#代码打包引用 c# 压缩效率
立即提问