CSharp使用FillClosedCurve填充封闭曲线

标签:
csharpgdi图形程序设计it |
分类: c# |
FillClosedCurve方法用于填充封闭曲线的内部。
FillMode枚举指定了填充封闭路径的内部的方式。一共有两种填充模式,即交替模式(Alternate)或环绕模式(Winding)。默认模式是Alternate.只有在曲线与自身相交的情况下,才需要使用填充模式。
程序运行效果见图一。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace FillClosedCurve
{
}
图一:
http://s3/middle/5fd719d64937399827982&690
这个例子与前一个不同,它使用了Form的paint方法创建Graphics对象:
e.Graphics.FillClosedCurve(blueBrush, ptsArrar,
flMode, tension);