手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#使用Region对图形区域构造和填充的方法
C#使用Region对图形区域构造和填充的方法
摘要:本文实例讲述了C#使用Region对图形区域构造和填充的方法。分享给大家供大家参考。具体如下:usingSystem;usingSystem...

本文实例讲述了C#使用Region对图形区域构造和填充的方法。分享给大家供大家参考。具体如下:

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 Form15 : Form { public Form15() { InitializeComponent(); } private void Form15_Paint(object sender, PaintEventArgs e) { GraphicsPath myPath = new GraphicsPath(); string stringText = "zhuzhao"; FontFamily family = new FontFamily("Arial"); int fontStyle = (int)FontStyle.Italic; int emSize = 26; Point origin = new Point(20, 20); StringFormat format = StringFormat.GenericDefault; myPath.AddString(stringText,family,fontStyle,emSize,origin,format); Region region = new Region(myPath); e.Graphics.FillRegion(Brushes.Red, region); } } }

希望本文所述对大家的C#程序设计有所帮助。

【C#使用Region对图形区域构造和填充的方法】相关文章:

C#连接MySql数据库的方法

C#中使用split分割字符串的几种方法小结

C#生成sitemap站点地图的方法

使用c#在word文档中创建表格的方法详解

C#操作注册表的方法

C#访问PostGreSQL数据库的方法

基于c#图像灰度化、灰度反转、二值化的实现方法详解

C#中判断本地系统的网络连接状态的方法

c#.net 常用函数和方法集

解决C#全屏幕截图的实现方法

精品推荐
分类导航