c#中区域填充的类代码是什么?编程代码是?急需
1个回答
推荐于2016-12-05 · 知道合伙人软件行家
关注
展开全部
这篇文章主要介绍了C#使用Region对图形区域构造和填充的方法,实例分析了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);
}
}
}
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);
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |