C#图形区域剪切的实现方法
本文实例讲述了C#图形区域剪切的实现方法。分享给大家供大家参考。具体如下:
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Drawing.Drawing2D;
namespaceadvanced_drawing
{
publicpartialclassForm16:Form
{
publicForm16()
{
InitializeComponent();
}
privatevoidForm16_Paint(objectsender,PaintEventArgse)
{
Graphicsg=e.Graphics;
GraphicsPathpath=newGraphicsPath();
path.AddEllipse(this.ClientRectangle);
Regionregoin=newRegion(path);
g.DrawPath(Pens.Red,path);
g.Clip=regoin;
Rectanglerect=this.ClientRectangle;
rect.Offset(10,10);
rect.Width-=20;
rect.Height-=20;
g.FillRectangle(Brushes.Black,rect);
g.DrawString("zhuzhao",this.Font,Brushes.Blue,100,100);
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
热门推荐
10 中考祝福语给同学简短
11 剪纸送祝福语大全简短
12 同事生日祝福语简短独特
13 老人去世简短祝福语
14 医美的祝福语大全简短
15 卖奶茶开张祝福语简短
16 学生国庆简短的祝福语
17 生日祝福语 简短独特男童
18 新婚宴祝福语简短大全