惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - 颜昌钢

怎样做好一个项目经理? ICollection 与 IList 区别 oracle 数据库跨库查询方法 SetTimeOut 与 SetInterval 区别 - 颜昌钢 内存释放 机制 remoting 学习整理 wpf windows 放大缩小 疑问?? - 颜昌钢 GC 资源 回收 方法参数 Ref 与 引用类型 DataTrigger 以及 EnterActions 和ExitActions 学习笔记 - 颜昌钢 WPF xaml文件中使用大括号{} - 颜昌钢 - 博客园 WPF下的地图解决方案 关于WPF的Binding 的 ConverterParameter 参数的动态设置 关于 项目 投标相关文档 服务器计时器、Windows 计时器和线程计时器 wpf小控件 集合 仪表盘等 wpf button 事件的触发顺序 - 颜昌钢 c# 插件 体系 一个类似于 splittercontainer 控件的控件
WPF中代码画箭头
颜昌钢 · 2010-03-01 · via 博客园 - 颜昌钢

本文没什么内容,主要是一些代码的集合;

1:WPF中后台代码画一条类似于箭头线的线条;

箭头线

// Fields
    private double mArrowAngle = 0.17453292519943295;
    
private double mArrowLengh = 30.0;// Methods
    public override Geometry Create(double x1, double y1, double x2, double y2)
    {
        Point point 
= new Point(x1, y1);
        Point point2 
= new Point(x2, y2);
        
double num = Math.Atan((y2 - y1) / (x2 - x1));
        
double d = num - this.ArrowAngle;
        
double num3 = num + this.ArrowAngle;
        
int num4 = (x2 > x1) ? -1 : 1;
        
double x = x2 + ((num4 * this.ArrowLengh) * Math.Cos(d));
        
double y = y2 + ((num4 * this.ArrowLengh) * Math.Sin(d));
        
double num7 = x2 + ((num4 * this.ArrowLengh) * Math.Cos(num3));
        
double num8 = y2 + ((num4 * this.ArrowLengh) * Math.Sin(num3));
        Point point3 
= new Point(x, y);
        Point point4 
= new Point(num7, num8);
        PathGeometry geometry 
= new PathGeometry();
        PathFigure figure 
= new PathFigure();
        figure.IsFilled 
= true;
        figure.StartPoint 
= point2;
        Point[] points 
= new Point[] { point, point2, point3, point4, point2 };//从point2到point 然后在倒回来到point2,然后画箭头。及从point2到point3到point4到point2.....
        PolyLineSegment segment 
= new PolyLineSegment(points, true);
        figure.Segments.Add(segment);
        geometry.Figures.Add(figure);
        geometry.Freeze();
        
return geometry;
    }
// Properties
    public double ArrowAngle
    {
        
get
        {
            
return this.mArrowAngle;
        }
        
set
        {
            
this.mArrowAngle = value;
        }
    }
public double ArrowLengh
    {
        
get
        {
            
return this.mArrowLengh;
        }
        
set
        {
            
this.mArrowLengh = value;
        }
    }