巨大的石头

在这里寻找精彩人生

导航

随笔分类 -  WPF应用

ScaleTransform模拟3D旋转
摘要:<Window x:Class="WpfApplication5.Window4" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window4" Height="1080" Width="1000"> <Canvas> <Image Wi 阅读全文

posted @ 2012-04-27 16:13 巨大的石头

WPF Style-ControlTemplate 使用
摘要:WPF Style使用 阅读全文

posted @ 2012-04-18 15:58 巨大的石头 阅读(6753) 评论(2) 推荐(0)

Singleton模式之多线程
摘要:一、引言自己也算是使用Singleton的老客户了,也明白如何写代码能最大限度的避免多线程产生多个实例。但是自己却很少遇到在多线程下使用Singleton,所以自己也是一知半解。今天正好有空,搞搞清楚这个问题。二、问题的产生请看如下代码:public class Animal { private static Animal instance = null; private Animal() { } public static Animal getInstance() { if (instance == null) { instance = new Animal(); } return inst 阅读全文

posted @ 2011-03-28 13:51 巨大的石头 阅读(859) 评论(0) 推荐(0)

WPF中的画笔功能,实现直实线、弯实线、直虚线、弯虚线
摘要:1、InkCanvas类。实现画板需要用到InkCanvas。一般情况下不需任何代码就可以在上面画线了。如果需要设置画笔颜色、笔尖大小等就需要设置DefaultDrawingAttributes,例如:DrawingAttributes attributes = new DrawingAttributes();attributes.Color = Colors.Black;attributes.Height = 50;attributes.Width = 50;attributes.FitToCurve = true;2、在InkCanvas上画直线方法:在StrokeCollected事件中 阅读全文

posted @ 2011-01-28 14:55 巨大的石头 阅读(6894) 评论(1) 推荐(1)

打赏