会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
霍莉雪特
新たな始まり~
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
11
12
13
14
15
16
17
18
19
···
22
下一页
2017年4月21日
【C#】图像的变形/变换/扭曲。用Emgu或YLScsFreeTransform(FreeImageTransformation)或MagickImage
摘要: 需求:将图像变形,如矩形图片变换成梯形的,图素拉伸。 解决方案:目前找到有两种。 使用EmguCV,它是.Net版的OpenCV。推荐直接在VS里的Nuget中搜索EmguCV进行下载。 使用第三方库FreeImageTransformation。(网上搜YLScsFreeTransform关键字)
阅读全文
posted @ 2017-04-21 16:02 霍莉雪特
阅读(3096)
评论(2)
推荐(0)
2017年4月12日
【C#】遍历List列表的同时,移除访问到的元素
摘要: 需求:遍历List列表,当访问的元素符合某一条件时,将该元素移除出列表。 注意点:使用foreach循环遍历无法做到边读边修改,所以要使用for循环。 例子: // 倒序遍历。 for (int i = list.Count - 1; i >= 0 ; i--) { if (list[i].name
阅读全文
posted @ 2017-04-12 09:42 霍莉雪特
阅读(1049)
评论(0)
推荐(0)
2017年4月7日
【WPF】动态设置Binding的ConverterParameter转换器参数
摘要: 问题:XAML中,想要在一个Bingding语句中再次Bingding。 Source="{Binding Path=Image,Converter={StaticResource UMatToBitmapSourceConverter},ConverterParameter={Binding Is
阅读全文
posted @ 2017-04-07 11:10 霍莉雪特
阅读(4885)
评论(0)
推荐(0)
2017年3月31日
【SVN/Visual Studio】清除/更换AnkhSVN的用户登录信息
摘要: 问题: 在VS开发环境下,使用SVN做版本控制,用了TortoiseSVN和插件AnkhSVN。提交代码到SVN服务器时,发现用的是别人的SVN帐号,不是自己的号(比如该电脑之前是别人在使用)。想要清除/重置之前的用户登录信息,改为登录自己的SVN帐号。 注意,由于使用了SVN及SVN的插件,需要同
阅读全文
posted @ 2017-03-31 15:35 霍莉雪特
阅读(407)
评论(0)
推荐(0)
【C#】允许泛型方法<T>返回空值Null
摘要: 在设计一个返回类型为T的泛型方法时,有时希望能返回空Null,然后会报错: 根据提示,将返回值由Null改为default(T)即可。 default(T)表示返回当前T类型的默认值,如果T为int则返回0。为了使确实能返回Null,可将该T类型继承自class类 where T : class,变
阅读全文
posted @ 2017-03-31 14:56 霍莉雪特
阅读(7909)
评论(0)
推荐(1)
【C#】时间日期格式转换:long和DateTime相互转换
摘要: // DateTime --> long public static long ConvertDateTimeToLong(DateTime dt) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970
阅读全文
posted @ 2017-03-31 09:51 霍莉雪特
阅读(14471)
评论(0)
推荐(0)
2017年3月30日
【C#/WPF】ListView的MVVM例子,及禁止拖动ListView的头部Header
摘要: 一个ListView的MVVM简单例子: <ListView ItemsSource="{Binding GoodsList}" Margin="0,10,0,10"> <ListView.View> <GridView> <GridViewColumn Header="套餐编号" Width="1
阅读全文
posted @ 2017-03-30 09:51 霍莉雪特
阅读(1326)
评论(0)
推荐(0)
2017年3月29日
【C#/WPF】保存BitmapImage数据到文件中
摘要: 参考: http://stackoverflow.com/questions/35804375/how-do-i-save-a-bitmapimage-from-memory-into-a-file-in-wpf-c /// <summary> /// 把内存里的BitmapImage数据保存到硬盘
阅读全文
posted @ 2017-03-29 16:33 霍莉雪特
阅读(3118)
评论(0)
推荐(0)
【C#/WPF】图像数据格式转换时,透明度丢失的问题
摘要: 问题:工作中涉及到图像的数据类型转换,经常转着转着发现,到了哪一步图像的透明度丢失了! 例如,Bitmap转BitmapImage的经典代码如下: public static BitmapImage BitmapToBitmapImage(System.Drawing.Bitmap bitmap)
阅读全文
posted @ 2017-03-29 14:59 霍莉雪特
阅读(920)
评论(0)
推荐(0)
2017年3月28日
【C#/WPF】图片的切割/切图/裁剪图片
摘要: 前台准备两个Image控件。上面是显示原图,下面显示切割后的效果。 <StackPanel Orientation="Vertical"> <Image Width="450" Height="383" Source="C:\Users\Administrator\Documents\Visual
阅读全文
posted @ 2017-03-28 15:31 霍莉雪特
阅读(3989)
评论(2)
推荐(0)
2017年3月27日
【C#/WPF】.Net生成二维码QRCode的工具
摘要: 先马 http://qrcodenet.codeplex.com/ 使用该工具WPF生成二维码的简单例子: 前台XAML准备一个Image控件显示二维码。 string qrcodeStr = "www.baidu.com"; QrEncoder qrEncoder = new QrEncoder(
阅读全文
posted @ 2017-03-27 11:06 霍莉雪特
阅读(1348)
评论(0)
推荐(0)
2017年3月22日
【C#】AddHandler可重复多次添加事件处理器的问题
摘要: 问题:在项目中发现,可以重复多次添加同一个Handler,导致触发时执行多次的问题。 这个现象也很好测试: 前台准备一个Label文本 <Label x:Name="label" Content="测试重复多次AddHandler点击事件" Width="300" Height="200" Hori
阅读全文
posted @ 2017-03-22 17:34 霍莉雪特
阅读(2422)
评论(0)
推荐(0)
2017年3月20日
【WPF/C#】拖拽Image图片控件
摘要: 需求:使得Image图片控件能够被拖动。 思路:关键是重写Image控件的几个鼠标事件,实现控制。 前台: <Image Source="C:\Users\Administrator\Documents\Visual Studio 2015\Projects\WpfApplication1\WpfA
阅读全文
posted @ 2017-03-20 09:56 霍莉雪特
阅读(3032)
评论(1)
推荐(0)
2017年3月17日
【C#/WPF】用Thumb做可拖拽的UI控件
摘要: 需求:简单的可拖拽的图片 使用System.Windows.Controls.Primitives.Thumb类 前台: <Canvas x:Name="g"> <Thumb Canvas.Left="10" Canvas.Top="20" Canvas.ZIndex="99" DragDelta=
阅读全文
posted @ 2017-03-17 15:41 霍莉雪特
阅读(3520)
评论(2)
推荐(1)
2017年3月11日
【C#/WPF】TextBlock/TextBox/Label编辑文字的问题
摘要: 标题有点描述不清,就当是为了方便自己用时易于搜索到。 总之需求是:显示用户信息(文字)时,允许用户编辑自己的信息。 效果图如下: 点击【编辑】按钮前: 点击【编辑】按钮后,允许编辑: 别吐槽为甚性别还能再改。。。我就是意思意思这个效果 使用了样式,但不是本文关注点,于是省略 按钮的作用也不是本文关注
阅读全文
posted @ 2017-03-11 09:31 霍莉雪特
阅读(1514)
评论(0)
推荐(0)
上一页
1
···
11
12
13
14
15
16
17
18
19
···
22
下一页
公告