C#

推荐列表 站点导航

当前位置:首页 > 脚本编程 > C# >

C#_C#实现图形路径变换的方法,本文实例讲述了C#实现图形路

来源:网络整理  作者:  发布时间:2020-12-19 20:25
C#实现图形路径变换的方法,本文实例讲述了C#实现图形路径变换的方法。分享给大家供大家参考。具体实现方法如下:...

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace advanced_drawing { public partial class Form10 : Form { public Form10() { InitializeComponent(); } GraphicsPath CreateLabeledRectPath(string label) { GraphicsPath path = new GraphicsPath(); Rectangle rect = new Rectangle(0, 0, 200, 200); FontFamily fontFamily=new FontFamily("Arial"); path.AddString(label, fontFamily, 20, 20f, new Point(0, 0), new StringFormat()); return path; } private void Form10_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; GraphicsPath path = CreateLabeledRectPath("zhuzhao"); g.DrawPath(Pens.Red, path); Matrix matrix = new Matrix(); matrix.Translate(150, 150); path.Transform(matrix); g.DrawPath(Pens.Black, path); } } }

相关热词: 方法 C# 实例

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/c/5737.shtml

最新文章
热门文章
Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

C#_C#实现图形路径变换的方法,本文实例讲述了C#实现图形路

2020-12-19 编辑:

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace advanced_drawing { public partial class Form10 : Form { public Form10() { InitializeComponent(); } GraphicsPath CreateLabeledRectPath(string label) { GraphicsPath path = new GraphicsPath(); Rectangle rect = new Rectangle(0, 0, 200, 200); FontFamily fontFamily=new FontFamily("Arial"); path.AddString(label, fontFamily, 20, 20f, new Point(0, 0), new StringFormat()); return path; } private void Form10_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; GraphicsPath path = CreateLabeledRectPath("zhuzhao"); g.DrawPath(Pens.Red, path); Matrix matrix = new Matrix(); matrix.Translate(150, 150); path.Transform(matrix); g.DrawPath(Pens.Black, path); } } }

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/c/5737.shtml

相关文章

风云图片

推荐阅读

返回C#频道首页