/// <summary>
/// 创建文本路径
/// </summary>
/// <param name="word">文本字符串</param>
/// <param name="point">显示位置</param>
/// <param name="typeface">字体信息</param>
/// <param name="fontSize">字体大小</param>
/// <returns></returns>
public static Geometry CreateTextPath(string word, Point point, Typeface typeface, int fontSize)
{
FormattedText text = new FormattedText(word,
new System.Globalization.CultureInfo("zh-cn"),
FlowDirection.LeftToRight, typeface, fontSize,
Brushes.Black);
Geometry geo = text.BuildGeometry(point);
PathGeometry path = geo.GetFlattenedPathGeometry();
return path;
}

使用:

 var pathgeometry = CreateTextPath("梦琪D路飞", new Point(, ), new Typeface(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Bold, FontStretches.Normal), (int)fontsize);

【WPF】创建文本字符串的路径PathGeometry的更多相关文章

  1. 2016/1/27 1, File 创建 删除 改名 换路径 2,输出流 不覆盖 换行输入 3,输入流

    1, File  创建  删除  改名  换路径 package Stream; import java.io.File; import java.io.IOException; public cla ...

  2. WPF中的PathAnimation(路径动画)

    原文:WPF中的PathAnimation(路径动画) WPF中的PathAnimation(路径动画)                                                 ...

  3. Javascript进阶篇——(DOM—节点---插入、删除和替换元素、创建元素、创建文本节点)—笔记整理

    插入节点appendChild()在指定节点的最后一个子节点列表之后添加一个新的子节点.语法: appendChild(newnode) //参数: //newnode:指定追加的节点. 为ul添加一 ...

  4. 【Java】大文本字符串滤重的简单方案~

    本文章也同步至本人的CSDN博客中: http://blog.csdn.net/u012881584/article/details/70477832 今天来说一个Java中处理大文本字符串虑重的两个 ...

  5. WPF绑定文本时使用指定格式文本

    原文:WPF绑定文本时使用指定格式文本 Text="{Binding PlayletModel.characters,StringFormat=Cast : {0}}" Strin ...

  6. [转] 利用shell创建文本菜单与窗口部件的方法

    [From] http://www.jb51.net/article/129460.htm 前言 创建交互式shell脚本最常用的方法是使用菜单.提供各种选项可以帮助脚本用户了解脚本能做什么,不能做什 ...

  7. HTML创建文本框的3种方式

    我的第一个随笔,记录主要用来整理学习的知识点 1.input 创建单行文本框 <input type="text" size="10" maxlength ...

  8. ASP.NET MVC 5 - 创建连接字符串(Connection String)并使用SQL Server LocalDB

    您创建的MovieDBContext类负责处理连接到数据库,并将Movie对象映射到数据库记录的任务中.你可能会问一个问题,如何指定它将连接到数据库? 实际上,确实没有指定要使用的数据库,Entity ...

  9. 《Entity Framework 6 Recipes》中文翻译系列 (38) ------ 第七章 使用对象服务之动态创建连接字符串和从数据库读取模型

    翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 第七章 使用对象服务 本章篇幅适中,对真实应用中的常见问题提供了切实可行的解决方案. ...

随机推荐

  1. java.util.Date和java.sql.Date 一点区别

    最近无意中发现,在oracle中同一样的一个Date类型字段,存储的日期格式有两种不同的情况,第一种是2011-1-1 12:00:00,第二种是2011-1-1,仔细查找发现在向数据库中写数据的时候 ...

  2. haproxy-1.7.7 基于域名的调度配置

    配置样列: [root@c01 haproxy-1.7.7]# cat conf/haproxy.cfg global log 127.0.0.1 local0 info #[err warning ...

  3. 菜鸟调错(二)——EJB3.0部署消息驱动Bean抛javax.naming.NameNotFoundException异常

    在部署EJB的消息驱动Bean时遇到了如下的错误: ERROR [org.jboss.resource.adapter.jms.inflow.JmsActivation] (WorkManager(2 ...

  4. android studio - Indexing paused due to batch updated

    傻逼的 Android Studio  又开抽疯了....  日 打开项目就出现   Indexing paused due to batch updated ,并且半天没反应........ 解决办 ...

  5. JavaScript 记录页面停留时间-通过测试

    <html> <head> <meta http-equiv="Content-Type" content="text/html; char ...

  6. [Windows Azure] How to use the Queue Storage Service

    How to use the Queue Storage Service version 1.7 version 2.0 This guide will show you how to perform ...

  7. IntelliJ IDEA 14.1.4导入项目启动报错:Error during artifact deployment.[组件部署期间出错]

    1.问题描述:Error during artifact deployment.[组件部署期间出错] 2.删除Artifacts 3.刷新 4.重新生成Artifacts 5.重新选择 再重新启动项目 ...

  8. 在IIS7上部署aspx网站

    在IIS7上部署aspx网站 2016-12-06 1 示例代码 WebForm.aspx内容: <html> <head> <script language=" ...

  9. Unique constraint on single String column with GreenDao2

    转:http://software.techassistbox.com/unique-constraint-on-single-string-column-with-greendao_384521.h ...

  10. 设置模式之单例模式(附上一个Objective-C编写的播放音乐的单例类)

    在查阅Cocoa Touch开发文档时,会发现框架中随处可见的大量单例类,比如说,UIApplication.NSFileManager 等. UIApplication 框架中极为常用的一个单例类, ...