C#圖形區(qū)域剪切的實現(xiàn)方法
更新時間:2015年06月12日 16:07:28 作者:zhuzhao
這篇文章主要介紹了C#圖形區(qū)域剪切的實現(xiàn)方法,涉及C#圖形操作的相關(guān)技巧,需要的朋友可以參考下
本文實例講述了C#圖形區(qū)域剪切的實現(xiàn)方法。分享給大家供大家參考。具體如下:
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 Form16 : Form
{
public Form16()
{
InitializeComponent();
}
private void Form16_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsPath path = new GraphicsPath();
path.AddEllipse(this.ClientRectangle);
Region regoin = new Region(path);
g.DrawPath(Pens.Red, path);
g.Clip = regoin;
Rectangle rect = 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#程序設計有所幫助。
相關(guān)文章
C# web.config之<customErrors>節(jié)點說明案例詳解
這篇文章主要介紹了C# web.config之<customErrors>節(jié)點說明案例詳解,本篇文章通過簡要的案例,講解了該項技術(shù)的了解與使用,以下就是詳細內(nèi)容,需要的朋友可以參考下2021-08-08
非常實用的C#字符串操作處理類StringHelper.cs
這篇文章主要為大家詳細介紹了非常實用的C#字符串操作處理類StringHelper.cs,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-07-07
簡單聊聊C#字符串構(gòu)建利器StringBuilder
因為String類型代表不可變字符串,所以無法對當前String類型實例進行處理.所以FCL提供了System.Text.StringBuilder類型,下面這篇文章主要給大家介紹了關(guān)于C#字符串構(gòu)建利器StringBuilder的相關(guān)資料,需要的朋友可以參考下2022-03-03

