当前注册人数423000人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB Android   站内搜索 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

WPF and .NET 3.5 - Drawing Customized Controls and Custom UI Elements

WPF中绘制定制的控件及定制UI元素(含Spirograph曲线实现示例源代码)

2007年12月27日
C# (C# 3.0), C#, VB, VB (VB 9.0), Windows (Vista), Windows, .NET, .NET (.NET 3.5), VS (VS2008), VS, XAML, WPF, Dev, Design
本文教你如何在WPF中绘制定制的控件和定制的UI元素,并且以绘制Spirograph曲线为例子,详细讲解!
相关知识
private void DrawStaticGraph(DrawingContext drawingContext)
{
    // PathGeometry is a nice alternative to drawingContext.DrawLine(...) as it 

    // allows the points to be rendered as an image that can be further manipulated

    PathGeometry geometry = new PathGeometry();

    // Add all points to the geometry

    foreach (Points pointXY in _points)
    {
        PathFigure figure = new PathFigure();
        figure.StartPoint = pointXY.FromPoint;
        figure.Segments.Add(new LineSegment(pointXY.ToPoint, true));
        geometry.Figures.Add(figure);
    }

    // Add the first point to close the gap from the graph's end point to graph's start point 

    PathFigure lastFigure = new PathFigure();
    lastFigure.StartPoint = _points[_points.Count - 1].FromPoint;
    lastFigure.Segments.Add(new LineSegment(_firstPoint, true));
    geometry.Figures.Add(lastFigure);

    // Create a new drawing and drawing group in order to apply a custom drawing effect

    GeometryDrawing drawing = new GeometryDrawing(this.Pen.Brush, this.Pen, geometry);
    DrawingGroup drawingGroup = new DrawingGroup();
    drawingGroup.Children.Add(drawing);

    ...
}
源代码原文下载:
WPF and .NET 3.5 - Drawing Customized Controls and Custom UI Elements Using Visual Studio 2008 for custom drawing using WPF and .NET 3.5; fun with Spirographs. I’m approaching this article as a platform to learn WPF myself, but I hope you find it instructional as well. I decided to write use the mathematical concept of an epicycloid as the subject for my first attempt at WPF. Most people will remember epicycloids from their youth as Spirographs. I had an endless with fascination drawing Spirograph artwork as a kid, so it seems fitting to resurrect the memory for a graphics-related article.

源码图片

点击链接查看大图
从本站下载附件及源代码(1个附件,已经成功下载422次)

最值得关注的外文源代码

Openbravo ERP
DrawMe - A network ink-chat application exploring .NET 3.5, WPF and WCF
WCF / WPF Chat Application
Not OLE .Net/WPF container of MFC applications
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论60次,此处显示最近20次评论! 查看所有评论

lf8013  2017年08月03日
很好,真的不错,要好好认真学习一下,谢谢
yezsoso  2016年10月18日
不错,学习一下,谢谢
yndxstxy2010jrsx  2015年11月01日
kankana
萧瑟  2014年04月30日
新手两天以后才能下载啊~ 我急等着用
liubo4869  2013年05月11日
新手两天以后才能下载啊~ 我急等着用呢
HJZ  2013年05月06日
值得学习,不错!!
gj1000  2013年01月06日
值得学习,不错的源码!
yongyuandeyihao  2012年10月15日
谢谢分享!
yongyuandeyihao  2012年10月09日
谢谢分享
yongyuandeyihao  2012年09月30日
henhao
cindy_yaya  2012年07月03日
非常感谢!!!!
Robin  2011年12月28日
还可以
Dragon  2011年09月19日
下载学习学习,谢谢分享
hcxlc  2011年07月28日
就想要这样学学`````
小麻雀  2010年11月16日
值得学习,不错的源码
平民  2010年05月11日
这里下载不了的话,可以单击"源代码原文下载"部分,到源码网站去下载.当然,在这里可以下载的话,还是从这里下载啊.
ocean  2009年12月18日
效果不错诶。
JessyZhang  2009年08月30日
源码不错,可惜的是我这个菜鸟就是下载不了啊
杨文文  2009年05月23日
Web Conference DrawMe - A network
sunnyj  2009年04月01日
Good.
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明